diff --git a/src/components/shared/ExerciseSide.tsx b/src/components/shared/ExerciseSide.tsx index d55d764..2617d1a 100644 --- a/src/components/shared/ExerciseSide.tsx +++ b/src/components/shared/ExerciseSide.tsx @@ -8,8 +8,8 @@ import AxisParent from './Exercises/AxisParent'; import GraphExercise from './Exercises/GraphExercise'; import GraphInput from './Exercises/GraphInput'; //import AxisParent from './Exercises/AxisParent'; -import UnitCircleExercise from './Exercises/UnitCircleExercise'; -import UnitCircleInput from './Exercises/UnitCircleInput'; +import UnitCircleParent from './Exercises/UnitCircleParent'; + ('./Exercises/AxisExercise'); interface ExerciseSideProps { @@ -216,21 +216,27 @@ ExerciseSideProps): JSX.Element { curExercise = (
{label} = {direction}{' '}
@@ -44,7 +44,7 @@ function UnitCircleInput({ function checkAnswer() { // Invoked to check answers and switch to the next question or set the answer wrong for (let i = 0; i < answers[counter].length; i++) { - if (inputText[i] != answers[counter][i]) { + if (parseInt(inputText[i]) != answers[counter][i]) { setWrong(true); return; } @@ -61,30 +61,6 @@ function UnitCircleInput({ nextExercise(); } - const answers: number[][] = []; - const questionLabels: string[][] = []; - const questionDirections: string[][] = []; - for (let i = 0; i < markers.length; i++) { - const currentAnswers = []; - const currentLabels = []; - const currentDirections = []; - const length = markers[i].length; - for (let j = 0; j < length; j++) { - if (labels[i][j] !== '') { - 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]); - } - } - answers.push(currentAnswers); - questionLabels.push(currentLabels); - questionDirections.push(currentDirections); - } - function wrongMessage(isWrong: boolean) { if (isWrong) { return "That's not quite right. Try again!"; @@ -112,8 +88,8 @@ function UnitCircleInput({ for (let i = 0; i < questionLabels[counter].length; i++) { questions.push({ label: questionLabels[counter][i], - direction: questionDirections[counter][i], answer: answers[counter][i], + direction: directions[counter][i], id: i, }); } @@ -121,7 +97,6 @@ function UnitCircleInput({ return