|
|
|
@ -127,71 +127,15 @@ export default function TestEdit() { |
|
|
|
style={{ marginBottom: 16 }} |
|
|
|
style={{ marginBottom: 16 }} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<Title level={2}>{test.title}</Title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{test.description && ( |
|
|
|
|
|
|
|
<Text type="secondary" style={{ display: 'block', marginBottom: 16 }}> |
|
|
|
|
|
|
|
{test.description} |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Card style={{ marginBottom: 24 }}> |
|
|
|
|
|
|
|
<Descriptions column={3}> |
|
|
|
|
|
|
|
<Descriptions.Item label="Вопросов">{test.questions.length}</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Порог зачёта">{test.passing_score}%</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Таймер"> |
|
|
|
|
|
|
|
{test.time_limit ? `${test.time_limit} мин` : 'Без ограничений'} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Возврат к вопросу"> |
|
|
|
|
|
|
|
{test.allow_navigation_back ? ( |
|
|
|
|
|
|
|
<Tag color="green">Разрешён</Tag> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Tag color="red">Запрещён</Tag> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Версия">{test.version}</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Создан"> |
|
|
|
|
|
|
|
{new Date(test.created_at).toLocaleDateString('ru-RU')} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
</Descriptions> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Title level={3}>Вопросы ({test.questions.length})</Title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{test.questions.map((question, index) => ( |
|
|
|
|
|
|
|
<Card key={question.id} style={{ marginBottom: 12 }}> |
|
|
|
|
|
|
|
<Text strong> |
|
|
|
|
|
|
|
{index + 1}. {question.text} |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
<List |
|
|
|
|
|
|
|
style={{ marginTop: 10 }} |
|
|
|
|
|
|
|
dataSource={question.answers} |
|
|
|
|
|
|
|
renderItem={(answer: Answer) => ( |
|
|
|
|
|
|
|
<List.Item style={{ padding: '4px 0' }}> |
|
|
|
|
|
|
|
<Space> |
|
|
|
|
|
|
|
{answer.is_correct ? ( |
|
|
|
|
|
|
|
<CheckCircleTwoTone twoToneColor="#52c41a" /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<CloseCircleTwoTone twoToneColor="#d9d9d9" /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
<Text>{answer.text}</Text> |
|
|
|
|
|
|
|
</Space> |
|
|
|
|
|
|
|
</List.Item> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{versions.length > 1 && ( |
|
|
|
{versions.length > 1 && ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Title level={3} style={{ marginTop: 32 }}> |
|
|
|
<Title level={3}>История версий</Title> |
|
|
|
История версий |
|
|
|
|
|
|
|
</Title> |
|
|
|
|
|
|
|
<Table<TestListItem> |
|
|
|
<Table<TestListItem> |
|
|
|
dataSource={versions} |
|
|
|
dataSource={versions} |
|
|
|
rowKey="id" |
|
|
|
rowKey="id" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
pagination={false} |
|
|
|
pagination={false} |
|
|
|
|
|
|
|
style={{ marginBottom: 24 }} |
|
|
|
rowClassName={(record) => (record.id === test.id ? 'ant-table-row-selected' : '')} |
|
|
|
rowClassName={(record) => (record.id === test.id ? 'ant-table-row-selected' : '')} |
|
|
|
columns={ |
|
|
|
columns={ |
|
|
|
[ |
|
|
|
[ |
|
|
|
@ -241,6 +185,62 @@ export default function TestEdit() { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Title level={2}>{test.title}</Title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{test.description && ( |
|
|
|
|
|
|
|
<Text type="secondary" style={{ display: 'block', marginBottom: 16 }}> |
|
|
|
|
|
|
|
{test.description} |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Card style={{ marginBottom: 24 }}> |
|
|
|
|
|
|
|
<Descriptions column={3}> |
|
|
|
|
|
|
|
<Descriptions.Item label="Вопросов">{test.questions.length}</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Порог зачёта">{test.passing_score}%</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Таймер"> |
|
|
|
|
|
|
|
{test.time_limit ? `${test.time_limit} мин` : 'Без ограничений'} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Возврат к вопросу"> |
|
|
|
|
|
|
|
{test.allow_navigation_back ? ( |
|
|
|
|
|
|
|
<Tag color="green">Разрешён</Tag> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Tag color="red">Запрещён</Tag> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Версия">{test.version}</Descriptions.Item> |
|
|
|
|
|
|
|
<Descriptions.Item label="Создан"> |
|
|
|
|
|
|
|
{new Date(test.created_at).toLocaleDateString('ru-RU')} |
|
|
|
|
|
|
|
</Descriptions.Item> |
|
|
|
|
|
|
|
</Descriptions> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Title level={3}>Вопросы ({test.questions.length})</Title> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{test.questions.map((question, index) => ( |
|
|
|
|
|
|
|
<Card key={question.id} style={{ marginBottom: 12 }}> |
|
|
|
|
|
|
|
<Text strong> |
|
|
|
|
|
|
|
{index + 1}. {question.text} |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
<List |
|
|
|
|
|
|
|
style={{ marginTop: 10 }} |
|
|
|
|
|
|
|
dataSource={question.answers} |
|
|
|
|
|
|
|
renderItem={(answer: Answer) => ( |
|
|
|
|
|
|
|
<List.Item style={{ padding: '4px 0' }}> |
|
|
|
|
|
|
|
<Space> |
|
|
|
|
|
|
|
{answer.is_correct ? ( |
|
|
|
|
|
|
|
<CheckCircleTwoTone twoToneColor="#52c41a" /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<CloseCircleTwoTone twoToneColor="#d9d9d9" /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
<Text>{answer.text}</Text> |
|
|
|
|
|
|
|
</Space> |
|
|
|
|
|
|
|
</List.Item> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|