Commit 109ab3ca authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

a

parent ab596d53
...@@ -12,9 +12,9 @@ const QnA = [ ...@@ -12,9 +12,9 @@ const QnA = [
let Answers = [0,0,0] let Answers = [0,0,0]
localStorage.setItem('Answers', JSON.stringify(Answers)) localStorage.setItem('Answers', JSON.stringify(Answers))
let Solutions = [4, 3, 2] let Solutions = [4, 3, 2]
localStorage.setItem('Solutions', JSON.stringify(Solutions))
function Quiz() { function Quiz() {
const [question, setQuestion] = useState({ const [question, setQuestion] = useState({
...QnA[0], ...QnA[0],
i: 0, i: 0,
...@@ -26,11 +26,10 @@ function Quiz() { ...@@ -26,11 +26,10 @@ function Quiz() {
function handleQuestion() { function handleQuestion() {
setQuestion({ ...QnA[question.i + 1], i: question.i + 1, page: question.page + 1 }) setQuestion({ ...QnA[question.i + 1], i: question.i + 1, page: question.page + 1 })
setSelected("") //페이지 넘어가면 Your Answer 초기화 setSelected("") //페이지 넘어가면 selected 초기화
} }
let handleChange = (ev) => { let handleChange = (ev) => {
// ev.preventDefault() //새로고침 안되도록
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))
...@@ -69,7 +68,7 @@ function Quiz() { ...@@ -69,7 +68,7 @@ function Quiz() {
</div> </div>
<p className="h3 text-center text-danger "> <p className="h3 text-center text-danger ">
<Timer <Timer
initialTime={36000} initialTime={30010}
direction="backward" direction="backward"
checkpoints={[ checkpoints={[
{time:1, {time:1,
...@@ -84,7 +83,7 @@ function Quiz() { ...@@ -84,7 +83,7 @@ function Quiz() {
> >
{() => ( {() => (
<> <>
<Timer.Minutes /> : <Timer.Seconds></Timer.Seconds> / 60 : 00 </> <Timer.Minutes /> : <Timer.Seconds></Timer.Seconds> / 30 : 00 </>
)} )}
</Timer> {/* npm i react-compound-timer */} </Timer> {/* npm i react-compound-timer */}
</p> </p>
......
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