Skip to content

Commit

Permalink
Made the answer depend on the "left" or "right" value in the question (
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaten committed Feb 28, 2024
1 parent af07904 commit b36ed0a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/shared/Exercises/UnitCircleInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function UnitCircleInput({
nextExercise();
}

const answers: string[][] = [];
const answers: number[][] = [];
const questionLabels: string[][] = [];
const questionDirections: string[][] = [];
for (let i = 0; i < markers.length; i++) {
Expand All @@ -71,7 +71,11 @@ function UnitCircleInput({
const length = markers[i].length;
for (let j = 0; j < length; j++) {
if (labels[i][j] !== '') {
currentAnswers.push(markers[i][j].slice(0, -1));
let multiplier = 1;
if (directions[i][j] == 'left') {
multiplier = -1;
}
currentAnswers.push(parseInt(markers[i][j].slice(0, -1)) * multiplier);
currentLabels.push(labels[i][j]);
currentDirections.push(directions[i][j]);
}
Expand Down

0 comments on commit b36ed0a

Please sign in to comment.