Commit 3411ed91 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

퀴즈 작성후 복귀

parent b54f3c44
import React, { useState } from "react";
import {Link} from 'react-router-dom'
import Button from "react-bootstrap/Button";
import Form from "react-bootstrap/Form";
import Col from "react-bootstrap/Col";
import Modal from "react-bootstrap/Modal";
import authHelpers from "../auth/auth-helpers";
import { create } from "./api-quiz";
// import NewProblem from "./NewProblem";
......@@ -10,6 +12,8 @@ import Problem from "./Problem";
function NewQuiz() {
const [title, setTitle] = useState('')
const [problems, setProblems] = useState([])
const [show, setShow] = useState(false)
const [quiz, setQuiz] = useState({})
const jwt = authHelpers.isAuthenticated();
......@@ -39,6 +43,8 @@ function NewQuiz() {
console.log(data.error);
} else {
console.log(data);
setQuiz(data)
setShow(true)
}
}
);
......@@ -58,6 +64,19 @@ function NewQuiz() {
}
<NewQuizProblem addProblem={addProblem} />
<Button onClick={clickSubmit}>퀴즈 저장</Button>
<Modal show={show}>
<Modal.Header>
<Modal.Title>New Quiz</Modal.Title>
</Modal.Header>
<Modal.Body>
New Quiz successfully created.
</Modal.Body>
<Modal.Footer>
<Link to={`/quiz/${quiz._id}`}>
<Button>Go to quiz</Button>
</Link>
</Modal.Footer>
</Modal>
</div>
);
}
......
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