Commit 96ab4893 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge branch 'Sangjune' into jiwon

parents da897cd7 e4f2db26
...@@ -9,11 +9,11 @@ let QuizBtn = [] ...@@ -9,11 +9,11 @@ let QuizBtn = []
function Admin() { function Admin() {
let QnAadmins = []
let QnAadmin = {}
// let QnAadmin = [] let Setadmins = []
// let Q = [] let Setadmin = {}
// let choose = []
// let N = []
const [result, setresult] = useState('') const [result, setresult] = useState('')
// const [addQuiz, setaddQuiz] = useState('') // const [addQuiz, setaddQuiz] = useState('')
......
...@@ -16,16 +16,14 @@ localStorage.setItem('Solutions', JSON.stringify(Solutions)) ...@@ -16,16 +16,14 @@ localStorage.setItem('Solutions', JSON.stringify(Solutions))
function Quiz() { function Quiz() {
const [question, setQuestion] = useState({ const [question, setQuestion] = useState({
...QnA[0], ...QnA[0]
i: 0,
page: 0,
}) })
const [selected, setSelected] = useState("") //선택한 답을 보여줄 것 const [selected, setSelected] = useState("") //선택한 답을 보여줄 것
const [timeout, settimeout] = useState(false) const [timeout, settimeout] = useState(false)
function handleQuestion() { function handleQuestion() {
setQuestion({ ...QnA[question.i + 1], i: question.i + 1, page: question.page + 1 }) setQuestion({ ...QnA[question.N]})
setSelected("") //페이지 넘어가면 selected 초기화 setSelected("") //페이지 넘어가면 selected 초기화
} }
...@@ -59,7 +57,7 @@ function Quiz() { ...@@ -59,7 +57,7 @@ function Quiz() {
</form> </form>
<span className="h5 font-weight-bold"> Your Answer :</span> <span className="h5 font-weight-bold"> Your Answer :</span>
<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.N-1 === QnA.length - 1)
? <Link to="/end"> ? <Link to="/end">
<button className="btn btn-outline-success" onClick={localStorage.setItem('Solutions', JSON.stringify(Solutions))}>제출</button> <button className="btn btn-outline-success" onClick={localStorage.setItem('Solutions', JSON.stringify(Solutions))}>제출</button>
</Link> </Link>
......
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