1
- import { useEffect , useState } from "react" ;
1
+ import { useEffect , useState , type FC } from "react" ;
2
2
import Image from "next/image" ;
3
3
import { Question } from "./types" ;
4
4
import { FieldArray , FormikProvider , Field , useFormik } from "formik" ;
5
+ import { useForm } from "react-hook-form" ;
5
6
import { Button } from "./Button" ;
6
7
import useResults from "@azure-fundamentals/hooks/useResults" ;
7
8
@@ -24,7 +25,7 @@ type Props = {
24
25
images ?: { url : string ; alt : string } [ ] ;
25
26
} ;
26
27
27
- const QuizExamForm : React . FC < Props > = ( {
28
+ const QuizExamForm : FC < Props > = ( {
28
29
isLoading,
29
30
handleNextQuestion,
30
31
handleSkipQuestion,
@@ -44,7 +45,7 @@ const QuizExamForm: React.FC<Props> = ({
44
45
} ) => {
45
46
const [ showCorrectAnswer , setShowCorrectAnswer ] = useState < boolean > ( false ) ;
46
47
const [ savedAnswers , setSavedAnswers ] = useState < any > ( [ ] ) ;
47
- const { points, reCount } = useResults ( savedAnswers ) ;
48
+ const { points, reCount } = useResults ( ) ;
48
49
const [ selectedImage , setSelectedImage ] = useState < {
49
50
url : string ;
50
51
alt : string ;
@@ -301,7 +302,9 @@ const QuizExamForm: React.FC<Props> = ({
301
302
} `}
302
303
>
303
304
< svg
304
- className = { `border ${ noOfAnswers > 1 ?"rounded" :"rounded-full" } absolute h-5 w-5 p-0.5 ${
305
+ className = { `border ${
306
+ noOfAnswers > 1 ? "rounded" : "rounded-full"
307
+ } absolute h-5 w-5 p-0.5 ${
305
308
showCorrectAnswer &&
306
309
formik . values . options [ index ] ?. isAnswer
307
310
? "text-emerald-500 border-emerald-600"
0 commit comments