diff --git a/src/app/examtable/_components/Table/Table.module.scss b/src/app/examtable/_components/Table/Table.module.scss index aeb4e72d..67bc0d28 100644 --- a/src/app/examtable/_components/Table/Table.module.scss +++ b/src/app/examtable/_components/Table/Table.module.scss @@ -72,6 +72,13 @@ } } +.choices_header { + display: block; + text-align: center; + font-size: 1.1em; + font-weight: bold; +} + // ボタン .button_container { position: fixed; diff --git a/src/app/examtable/_components/Table/Table.tsx b/src/app/examtable/_components/Table/Table.tsx index 49ac0573..22cc5255 100644 --- a/src/app/examtable/_components/Table/Table.tsx +++ b/src/app/examtable/_components/Table/Table.tsx @@ -39,24 +39,19 @@ export function Table(props: ExamTableProps): React.ReactElement { [0, 0], ) ?? [undefined, undefined]; - const choices: string[] = React.useMemo( + const choices: string[][] = React.useMemo( () => props.exam.map(exam => { - let array: string[]; switch (exam.type) { case 'Select': case 'MultiSelect': case 'ListSelect': - array = exam.question_choices ?? []; - break; + return exam.question_choices ?? []; case 'Sort': - array = Shuffle(exam.answer); - break; + return Shuffle(exam.answer); default: - array = []; - break; + return []; } - return array.join(' | '); }), [], ); @@ -127,11 +122,16 @@ export function Table(props: ExamTableProps): React.ReactElement { {exam.question} - {choices[i] !== '' && ( + {choices[i].length !== 0 && ( <>

- 選択肢:{choices[i]} + [選択肢] + )}