diff --git a/src/components/shared/Exercises/GraphInput.tsx b/src/components/shared/Exercises/GraphInput.tsx index b3d9a39..5802c11 100644 --- a/src/components/shared/Exercises/GraphInput.tsx +++ b/src/components/shared/Exercises/GraphInput.tsx @@ -1,5 +1,5 @@ //import { useState } from 'react'; -//import { useState } from 'react'; +import { useState } from 'react'; import '../../../styles/Exercises/GraphInput.scss'; interface GraphQuestionData { @@ -105,14 +105,25 @@ function GraphInput({ //console.log(i); if (!i) { //console.log(`${i} is incorrect`); - //setWrong(true); + setWrong(true); return; } } //console.log('all right!'); nextExercise(); + }; + function wrongMessage(isWrong: boolean) { + if (isWrong) { + return "That's not quite right. Try again!"; + } else { + return; + } + } + + const [wrong, setWrong] = useState(false); + const makeLine = ( data: GraphLineData, setCorrect: (id: number, value: boolean) => void @@ -128,6 +139,9 @@ function GraphInput({
{questionArray.map((x) => makeLine(x, setValueCorrect))}
+
+

 {wrongMessage(wrong)} 

+