diff --git a/src/app/components/editor.tsx b/src/app/components/editor.tsx index d388ffd..519f3dc 100644 --- a/src/app/components/editor.tsx +++ b/src/app/components/editor.tsx @@ -93,12 +93,16 @@ interface QuestionInput { } interface ChoiceInput { + readonly id: number answer: string isFixedPosition: boolean isCorrect: boolean } +let choiceCounter = 0 + const newChoice = (): ChoiceInput => ({ + id: choiceCounter++, answer: '', isFixedPosition: false, isCorrect: false, @@ -299,45 +303,16 @@ function QuestionSetEditor({ }} /> -
Answer | -Correct | -- Fixed Position - | -
---|
Answer | +Correct | +Fixed Position | +
---|---|---|
+ { + handleInternalChoiceUpdate(choice.id, { + answer: e.target.value, + }) + }} + aria-label={QuestionSetEditorAriaLabel.answerInput({ + choiceNumber, + questionNumber, + })} + /> + | ++ { + handleInternalChoiceUpdate(choice.id, { + isCorrect: e.target.checked, + }) + }} + aria-label={QuestionSetEditorAriaLabel.isCorrectAnswerCheckbox( + { + choiceNumber, + questionNumber, + }, + )} + /> + | ++ { + handleInternalChoiceUpdate(choice.id, { + isFixedPosition: e.target.checked, + }) + }} + /> + | +