Commit fa3d05da authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

wlsWk

parent 8c2acaf7
...@@ -13,7 +13,6 @@ let Answers = [] ...@@ -13,7 +13,6 @@ let Answers = []
let Solutions = [4, 3, 2] let Solutions = [4, 3, 2]
function Quiz() { function Quiz() {
localStorage.setItem('Solutions', JSON.stringify(Solutions))
const [question, setQuestion] = useState({ const [question, setQuestion] = useState({
...QnA[0], ...QnA[0],
...@@ -32,6 +31,7 @@ function Quiz() { ...@@ -32,6 +31,7 @@ function Quiz() {
setSelected(ev.target.value) //selected값 변경 setSelected(ev.target.value) //selected값 변경
Answers[question.N - 1] = Number(ev.target.id) + 1 Answers[question.N - 1] = Number(ev.target.id) + 1
localStorage.setItem('Answers', JSON.stringify(Answers)) localStorage.setItem('Answers', JSON.stringify(Answers))
console.log(Answers)
} }
return ( return (
...@@ -61,7 +61,7 @@ function Quiz() { ...@@ -61,7 +61,7 @@ function Quiz() {
<span className="h2 font-weight-bold text-danger"> {selected}</span> {/* 선택한 보여줌 */} <span className="h2 font-weight-bold text-danger"> {selected}</span> {/* 선택한 보여줌 */}
<div className="text-center my-3"> {(question.page === QnA.length - 1) <div className="text-center my-3"> {(question.page === QnA.length - 1)
? <Link to="/end"> ? <Link to="/end">
<button className="btn btn-outline-success">제출</button> <button className="btn btn-outline-success" onClick={localStorage.setItem('Solutions', JSON.stringify(Solutions))}>제출</button>
</Link> </Link>
: <button type="button" className="btn btn-outline-dark" onClick={handleQuestion}>다음</button> : <button type="button" className="btn btn-outline-dark" onClick={handleQuestion}>다음</button>
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment