Skip to content

Commit

Permalink
tweak comments more
Browse files Browse the repository at this point in the history
  • Loading branch information
handeyeco committed Sep 24, 2024
1 parent 2437282 commit e8d3659
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/perseus/src/widgets/radio/radio-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function radioValidator(
};
}

// TODO: this is almost certainly meant to be rubric.numCorrect
// TODO: should numCorrect actually be on the rubric
// instead of the userInput?
if (
userInput.numCorrect &&
userInput.numCorrect > 1 &&
Expand All @@ -31,9 +32,8 @@ function radioValidator(
// If NOTA and some other answer are checked, ...
}

// TODO: this is almost certainly meant to be rubric.noneOfTheAboveSelected
// or we should be comparing against noneOfTheAboveIndex and
// noneOfTheAboveSelected should not exist
// TODO: should noneOfTheAboveSelected be replaced with a
// combination of choicesSelected and noneOfTheAboveIndex?
if (userInput.noneOfTheAboveSelected && numSelected > 1) {
return {
type: "invalid",
Expand All @@ -43,7 +43,8 @@ function radioValidator(

const correct = userInput.choicesSelected.every((selected, i) => {
let isCorrect: boolean;
// TODO: this is almost certainly meant to be rubric.noneOfTheAboveIndex
// TODO: should noneOfTheAboveIndex actually be on the rubric
// instead of the userInput?
if (userInput.noneOfTheAboveIndex === i) {
isCorrect = rubric.choices.every((choice, j) => {
return i === j || !choice.correct;
Expand Down

0 comments on commit e8d3659

Please sign in to comment.