Commit 5d4ee11f authored by baesangjune's avatar baesangjune
Browse files

.

parent c836a803
......@@ -90,14 +90,14 @@ function Admin() {
<p className="navbar-text border-bottom">관리자 설정 변경하기</p>
<a className="nav-link" id="setting-tab" data-toggle='pill' href="#setting" role="tab">Setting</a>
<a className="nav-link" id="setting-tab" data-toggle='pill' href="#setting">Setting</a>
<p className="navbar-text border-bottom">Quiz 입력하기</p>
<a className="nav-link" id="Quiz1-tab" data-toggle="pill" href="#Quiz1" role="tab" >Quiz1</a>
<a className="nav-link" id="Quiz2-tab" data-toggle="pill" href="#Quiz2" role="tab" >Quiz2</a>
<a className="nav-link" id="Quiz3-tab" data-toggle="pill" href="#Quiz3" role="tab" >Quiz3</a>
<a className="nav-link" id="Quiz1-tab" data-toggle="pill" href="#Quiz1" >Quiz1</a>
<a className="nav-link" id="Quiz2-tab" data-toggle="pill" href="#Quiz2" >Quiz2</a>
<a className="nav-link" id="Quiz3-tab" data-toggle="pill" href="#Quiz3" >Quiz3</a>
{addQuiz}
<button className="btn btn-danger navbar-btn" onClick={handleClickQuiz} >Quiz 추가</button>
......@@ -113,20 +113,20 @@ function Admin() {
<div className="row d-flex justify-content-center">
<div className="col-8">
<h1 className="p-3 border">관리자 설정 변경 </h1>
<h2 className="p-3 border text-center bg-danger">관리자 설정변경</h2>
<div className="p-3 border">
<h2>변경할 비밀번호를 입력하세요</h2>
<input type="text" onChange={handleChangePassword} placeholder="New Password" />
<h3>변경할 비밀번호를 입력하세요</h3>
<input className='p-2' type="text" onChange={handleChangePassword} placeholder="New Password" />
</div>
<div className="p-3 border">
<h2>변경할 관리자 비밀번호를 입력하세요</h2>
<input type="text" onChange={handleChangeAdminPassword} placeholder="New Admin Password" />
<h3>변경할 관리자 비밀번호를 입력하세요</h3>
<input className='p-2' type="text" onChange={handleChangeAdminPassword} placeholder="New Admin Password" />
</div>
<div className="p-3 border">
<h2>타이머를 설정하세요(초단위)</h2>
<input type="text" onChange={handleChangeTime} placeholder="Set Time" />
<h3>타이머를 설정하세요(초단위)</h3>
<input className='p-2' type="text" onChange={handleChangeTime} placeholder="Set Time" />
</div>
......@@ -149,24 +149,24 @@ function Admin() {
<div className="row d-flex justify-content-center">
<div className="col-8">
<h2 className="p-3 border text-center">문제만들기</h2>
<h2 className="p-3 border text-center bg-danger ">문제만들기</h2>
<div className="p-3 borber">
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">1.</span>
{/* <input type="text" onChange={handleChangenumber} placeholder="Number" /> */}
<input type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
</div>
<div className="p-3 ">
<div className="input-group">
<div className="input-group-prepend">
<div className="input-group-text">
<div className="input-group-text p-3">
<input type="radio" id="option" />
</div>
</div>
<input type="text" className="form-control" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
<input type="text" className="form-control p-4" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
</div>
{selectOption}
......@@ -176,7 +176,7 @@ function Admin() {
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">정답:</span>
<input type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
</div>
<label for="inputLogin" className="d-flex justify-content-center">
......@@ -196,24 +196,24 @@ function Admin() {
<div className="row d-flex justify-content-center">
<div className="col-8">
<h2 className="p-3 border text-center">문제만들기</h2>
<h2 className="p-3 border text-center bg-danger">문제만들기</h2>
<div className="p-3 borber">
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">1.</span>
{/* <input type="text" onChange={handleChangenumber} placeholder="Number" /> */}
<input type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
</div>
<div className="p-3 ">
<div className="input-group">
<div className="input-group-prepend">
<div className="input-group-text">
<div className="input-group-text p-3">
<input type="radio" id="option" />
</div>
</div>
<input type="text" className="form-control" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
<input type="text" className="form-control p-4" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
</div>
{selectOption}
......@@ -223,7 +223,7 @@ function Admin() {
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">정답:</span>
<input type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
</div>
<label for="inputLogin" className="d-flex justify-content-center">
......@@ -240,24 +240,24 @@ function Admin() {
<div className="row d-flex justify-content-center">
<div className="col-8">
<h2 className="p-3 border text-center">문제만들기</h2>
<h2 className="p-3 border text-center bg-danger">문제만들기</h2>
<div className="p-3 borber">
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">1.</span>
{/* <input type="text" onChange={handleChangenumber} placeholder="Number" /> */}
<input type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeQuestion} placeholder="문제를 입력하세요" />
</div>
<div className="p-3 ">
<div className="input-group">
<div className="input-group-prepend">
<div className="input-group-text">
<div className="input-group-text p-3">
<input type="radio" id="option" />
</div>
</div>
<input type="text" className="form-control" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
<input type="text" className="form-control p-4" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
</div>
{selectOption}
......@@ -267,7 +267,7 @@ function Admin() {
<div className="p-3 ">
<span className="font-weight-bold mr-2 h3">정답:</span>
<input type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
<input className='p-2' type="text" onChange={handleChangeanswer} placeholder="정답을 입력하세요" />
</div>
<label for="inputLogin" className="d-flex justify-content-center">
......
......@@ -11,7 +11,7 @@ const QnA = [
{ Q: "3 - 1 = ?", Choose: [1, 2, 3, 4], N: 3 }
]
let Answers = [0,0,0]
let Answers = [0, 0, 0]
localStorage.setItem('Answers', JSON.stringify(Answers))
let Solutions = [4, 3, 2]
localStorage.setItem('Solutions', JSON.stringify(Solutions))
......@@ -41,64 +41,66 @@ function Quiz() {
}
return (
<>
<div className="container-fluid">
<div className="text-center h2 font-weight-bold bg-warning py-2">미적분학 퀴즈</div>
<div className="row justify-content-md-center" >
<div className="col text-right">
<h1>
<img src={logo} width='50' height='50' alt='question' />
</h1>
</div>
<div className="col-md-auto">
<div className="h2 mt-2">
{question.Q}
<div className="container-fluid">
<div className="text-center h2 font-weight-bold bg-warning py-2">미적분학 퀴즈</div>
<div className="row justify-content-md-center" >
<div className="col text-right">
<h1>
<img src={logo} width='50' height='50' alt='question' />
</h1>
</div>
<div className="mt-2">
<form>
{question.Choose.map((a, index) =>
<div key={index}>
<input type="radio" name='answer' id={index} value={a} onChange={handleChange} checked={parseInt(selected) === a} />
<label className="font-weight-bold" htmlFor={a}>{a}</label>
</div>
)}
</form>
<span className="h5 font-weight-bold"> Your Answer :</span>
<span className="h2 font-weight-bold text-danger"> {selected}</span> {/* 선택한 보여줌 */}
<div className="text-center my-3"> {(question.page === QnA.length - 1)
? <Link to="/end">
<button className="btn btn-outline-success" onClick={localStorage.setItem('Solutions', JSON.stringify(Solutions))}>제출</button>
</Link>
: <button type="button" className="btn btn-outline-dark" onClick={handleQuestion}>다음</button>
}
<div className="col-md-auto">
<div className="h2 mt-2">
{question.Q}
</div>
<p className="h3 text-center text-danger ">
<Timer
initialTime={36000}
direction="backward"
checkpoints={[
{time:1,
callback:()=>alert('시간이 초과되었습니다.'),
},
{
time: 0,
callback: () => settimeout(true),
}
]}
>
{() => (
<>
<Timer.Minutes /> : <Timer.Seconds></Timer.Seconds> / 60 : 00 </>
<div className="mt-2">
<form>
{question.Choose.map((a, index) =>
<div key={index}>
<input type="radio" name='answer' id={index} value={a} onChange={handleChange} checked={parseInt(selected) === a} />
<label className="font-weight-bold" htmlFor={a}>{a}</label>
</div>
)}
</Timer> {/* npm i react-compound-timer */}
</p>
</form>
<span className="h5 font-weight-bold"> Your Answer :</span>
<span className="h2 font-weight-bold text-danger"> {selected}</span> {/* 선택한 보여줌 */}
<div className="text-center my-3"> {(question.page === QnA.length - 1)
? <Link to="/end">
<button className="btn btn-outline-success" onClick={localStorage.setItem('Solutions', JSON.stringify(Solutions))}>제출</button>
</Link>
: <button type="button" className="btn btn-outline-dark" onClick={handleQuestion}>다음</button>
}
</div>
<p className="h3 text-center text-danger ">
<Timer
initialTime={36000}
direction="backward"
checkpoints={[
{
time: 1,
callback: () => alert('시간이 초과되었습니다.'),
},
{
time: 0,
callback: () => settimeout(true),
}
]}
>
{() => (
<>
<Timer.Minutes /> : <Timer.Seconds /> / 30 : 00
</>
)}
</Timer> {/* npm i react-compound-timer */}
</p>
</div>
</div>
<div className="col">
</div>
</div>
<div className="col">
</div>
</div>
</div>
{timeout ? <Redirect to='/end'/> : '' }
{timeout ? <Redirect to='/end' /> : ''}
</>
)
......
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