Commit dd0704fc authored by baesangjune's avatar baesangjune
Browse files

.

parent 16184ff8
......@@ -14,10 +14,7 @@ function Admin() {
}
function handleClickQuiz(e) {
(JSON.parse(localStorage.getItem('QnA')) === null) ? setresult(<AdminQuiz QuizNum={e.target.id} data={{Q:'x' , Choose:'x', A:'x'}} />) : setresult(<AdminQuiz QuizNum={e.target.id} data={JSON.parse(localStorage.getItem('QnA'))} />)
console.log('data')
console.log(data)
console.log(QuizNum)
(JSON.parse(localStorage.getItem('QnA')) === null) ? setresult(<AdminQuiz QuizNum={e.target.id} data={[{ Q: 'x', Choose: 'x', A: 'x' }]} />) : setresult(<AdminQuiz QuizNum={e.target.id} data={JSON.parse(localStorage.getItem('QnA'))} />)
}
function handleClickAddQuiz() {
......
......@@ -7,7 +7,6 @@ let QnAadmin = {}
let savechoose = {}
function AdminQuiz(props) {
const [question, setQuestion] = useState('')
const [choose, setChoose] = useState('')
const [answer, setAnswer] = useState('')
......
......@@ -4,6 +4,14 @@ import React, { useState } from 'react'
import { Redirect } from 'react-router-dom';
function Home() {
let info=[{password:"0319", AdminPassword:"0001",Time : "30010"}] //수정.추가
if(JSON.parse(localStorage.getItem("Set")) === null){
}
else{
info = JSON.parse(localStorage.getItem("Set"))
} //수정. 추가
const [name, setName] = useState('')
const [password, SetPassword] = useState('')
const [done, setDone] = useState(false)
......
......@@ -20,10 +20,10 @@ function Quiz() {
//for each 사용하기
let Solutions = [] //빈 배열
console.log(localQnA)
localQnA.map((x) => { //A만 꺼내서 q에 추가
// Answers.push(0)
return Solutions.push(x.A)
})
localQnA.forEach((element) => {
Solutions.push(Number(element.A))
});
useEffect(() => {
for (let i = 1; i <= Solutions.length; i++) {
Answers.push(0)
......
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