(atempted: any)
| 38 | const handleSubmit = (score: number) => { |
| 39 | setIsSubmitted(!isSubmitted); |
| 40 | function getScore(atempted: any) { |
| 41 | let score = 0; |
| 42 | for (const key in atempted) { |
| 43 | if (atempted[key]) { |
| 44 | score++; |
| 45 | } |
| 46 | } |
| 47 | score = parseInt(((score / questions.length) * 100).toPrecision(3)); |
| 48 | return score; |
| 49 | } |
| 50 | setScore(getScore(atempted)); |
| 51 | |
| 52 | console.log("in submit", score); |
no outgoing calls
no test coverage detected