import React from 'react' // import tr from './img_end.jpg'; // import { Link } from 'react-router-dom'; function End() { let result = '' let scores = [] let score = 0 const answers = JSON.parse(localStorage.getItem('Answers')) const solutions = JSON.parse(localStorage.getItem('Solutions')) for (let i = 0; i < answers.length; i++) { if (answers[i] === solutions[i]) { scores[i] = 1 } else if (answers[i] === 0) { scores[i] = -1 } else { scores[i] = 0 } score += scores[i] if (score <0){ score =0 } } return ( <>
응시자 | {localStorage.getItem('name')} |
---|---|
Quiz {index + 1} | 정답이 입력되지 않았습니다. |
Quiz {index + 1} | O |
Quiz {index + 1} | X |
총점 | {score}점 |