Commit 64f5ae98 authored by 김민수's avatar 김민수
Browse files

No commit message

No commit message
parent aca78a40
...@@ -11,15 +11,15 @@ const QnA = [ ...@@ -11,15 +11,15 @@ const QnA = [
] ]
function Quiz() { function Quiz() {
let [question, setQuestionss] = useState({ let [question, setQuestion] = useState({
...QnA[0], ...QnA[0],
i: 0, i: 0,
page: 0, page: 0,
}) })
let [selected, setSelected] = useState("") //선택한 답을 보여줄 것들 let [selected, setSelected] = useState("") //선택한 답을 보여줄 것들
function setQuestion() { function handleQuestion() {
setQuestionss({ ...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 })
} }
let handleChange = (ev) => { let handleChange = (ev) => {
ev.preventDefault() //새로고침 안되도록 ev.preventDefault() //새로고침 안되도록
...@@ -60,7 +60,7 @@ function Quiz() { ...@@ -60,7 +60,7 @@ function Quiz() {
</form> </form>
<p style={{ fontSize: "20px", marginLeft: "600px" }}>선택한 :<span style={{ color: "green", fontWeight: "bold", fontSize: "90px", marginLeft: "30px" }}> {selected}</span> {/* 선택한 보여줌 */}<span style={{ marginLeft: "50px" }}> {(question.page === QnA.length - 1) <p style={{ fontSize: "20px", marginLeft: "600px" }}>선택한 :<span style={{ color: "green", fontWeight: "bold", fontSize: "90px", marginLeft: "30px" }}> {selected}</span> {/* 선택한 보여줌 */}<span style={{ marginLeft: "50px" }}> {(question.page === QnA.length - 1)
? <Link to="/end">제출</Link> ? <Link to="/end">제출</Link>
: <button type="button" onClick={setQuestion} style={{ width: "85px", height: "40px" }} >다음</button> : <button type="button" onClick={handleQuestion} style={{ width: "85px", height: "40px" }} >다음</button>
}</span> }</span>
</p> </p>
...@@ -70,7 +70,7 @@ function Quiz() { ...@@ -70,7 +70,7 @@ function Quiz() {
{/* 마지막 질문일 경우 /end페이지로 이동, 그렇지 않을경우는 this.setQuestion발생 */} {/* 마지막 질문일 경우 /end페이지로 이동, 그렇지 않을경우는 this.setQuestion발생 */}
{/* {(question.page === QnA.length - 1) {/* {(question.page === QnA.length - 1)
? <Link to="/end">제출</Link> ? <Link to="/end">제출</Link>
: <button type="button" onClick={setQuestion} >다음</button> : <button type="button" onClick={handleQuestion} >다음</button>
} */} } */}
...@@ -84,7 +84,7 @@ function Quiz() { ...@@ -84,7 +84,7 @@ function Quiz() {
checkpoints={[ checkpoints={[
{ {
time: 0, time: 0,
callback: setQuestion callback: handleQuestion
// history.go(1) // history.go(1)
} }
]} ]}
......
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