Commit 8ecf5d32 authored by baesangjune's avatar baesangjune
Browse files

d

parent 2a7c6371
import React from 'react';
import logo from './logo.svg';
import './App.css';
import ReactDOM from 'react-dom';
let answer=[]
function App(props) {
let correctAnswer = {"1번": 3, "2번": 4}
function App() {
return (
<>
<div className="App">
<h1 style={{ background: "orange", display: "inline-block", border: "3px solid black", width: "200px" }}> Online-Quiz</h1>
</div>
<div className="App">
<h2>어떤 페이지가 나올까요? ^ ^</h2>
궁금합니다^ ^
이름을 입력하세요
<input onChange={(event) => { console.log(event.target.value) }} />
</div>
<button onClick={ShowQuiz1} style={{ margin: "30px", marginLeft: "355px", width: "150px", height: "30px", fontFamily : "impact"}}>Quiz Start ! </button>
</>
);
}
function Next() {
return alert("다음문제")
//선택한 정답과 실제정답이 일치하는지 판별
}
function Quiz1() {
return (
<>
<h2>Q1. 3 + 3 = ?</h2>
<div> 2</div>
<div> 4</div>
<div> 6</div>
<div> 8</div>
<div className="App" style={{ float: "left" }}>
정답을 입력하세요
<select id="number1">
<option value="0" hidden disabled selected>정답선택</option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
</select>
<button onClick={ShowQuiz2} style={{ marginLeft: "10px" }}>다음</button>
<meta http-equiv="Refresh" content="3; url=here"/>
</div>
</>
);
}
function ShowQuiz1() {
ReactDOM.render(
<React.StrictMode>
<Quiz1 />
</React.StrictMode>,
document.getElementById('root')
);
}
// function SelectAnswer(e){
// let a = document.getElementById("number1").value
// answer.push(a)
// }
function Quiz2() {
return (
<>
<h2>Q1. 6 x 4 = ?</h2>
<div> 6</div>
<div> 12</div>
<div> 18</div>
<div> 24</div>
<div className="App" style={{ float: "left" }}>
정답을 입력하세요
<select>
<option hidden disabled selected>정답선택</option>
<option value="6"></option>
<option value="12"></option>
<option value="18"></option>
<option value="24"></option>
</select>
<button onClick={Showlast} style={{ marginLeft: "10px" }}>다음</button>
<meta http-equiv="Location" content="here" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{localStorage.setItem('Answer1', 'select id')
, localStorage.getItem('Answer1'), localStorage.removeItem, localStorage.clear}
</div>
</>
);
}
function ShowQuiz2() {
ReactDOM.render(
<React.StrictMode>
<Quiz2 />
</React.StrictMode>,
document.getElementById('root')
);
}
function Last() {
return (
<>
<div className="App" style={{ margin: "30px", fontSize: "2.0em" }}>Quiz 완료</div>
<h1 style={{ marginLeft: "298px" }}>수고하셨습니다 !!</h1>
</>
)
}
function Showlast() {
ReactDOM.render(
<React.StrictMode>
<Last />
</React.StrictMode>,
document.getElementById('root')
);
}
export default App;
// export default Quiz1;
\ No newline at end of file
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