Commit 69284cba authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge branch 'Sangjune' into jiwon

parents 1a7bab66 1d614f4a
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 14316 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 2576 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 14836 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 17100 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 4868 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 8464 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 788 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 17300 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 6896 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 8040 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 8896 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 9132 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 16536 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 6528 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 16632 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 15964 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 7384 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 16852 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 16272 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 13996 should be suspended, but previous_suspend_count is 0
[0727/174144.098:WARNING:process_reader_win.cc(156)] Thread 10612 should be suspended, but previous_suspend_count is 0
...@@ -15,21 +15,57 @@ class Quiz extends React.Component { ...@@ -15,21 +15,57 @@ class Quiz extends React.Component {
// this.setAnswer = this.setAnswer.bind(this) // this.setAnswer = this.setAnswer.bind(this)
this.setQuestion = this.setQuestion.bind(this) this.setQuestion = this.setQuestion.bind(this)
this.ShowQuiz = this.ShowQuiz.bind(this) this.ShowQuiz = this.ShowQuiz.bind(this)
this.answerbox = this.answerbox.bind(this)
this.state = { this.state = {
...question[0], ...question[0],
i: 0, i: 0,
page: 0, page: 0,
list: ""
} }
// this.textInput = React.createRef()
} }
ShowQuiz() { ShowQuiz() {
this.setState({ page: 1 }) this.setState({ page: 1 })
} }
setQuestion() { setQuestion() {
this.setState({ ...question[this.state.i + 1], i: this.state.i + 1}) //값이 입력되지 않은채로 넘겨졌을 때 문제 해결 해야 함-sj-
this.setState({ ...question[this.state.i + 1], i: this.state.i + 1 })
} }
//answerbox - answer박스의 값을 네임리스트로 받아와서 값을 localstorage에 저장
answerbox() {
let answers = document.getElementsByName('answer');
let count = answers.length
// var checked_index = -1;
var checked_value = '';
for (var i = 0; i < count; i++) {
if (answers[i].checked) {
// checked_index = i;
checked_value = answers[i].value;
localStorage.setItem('answer-'+i, checked_value)
}
}
// alert('선택된 항목 인덱스: ' + checked_index + '\n선택된 항목 값: ' + checked_value);
// if (document.getElementsByName("answer")[i].checked === true) {
// alert(document.getElementsByName("answer")[i].value);
// }
}
// setAnswer(e) {
// question[this.state.i]["A"] = e.target.value
// this.setState({ v: e.target.value })
// console.log(this.state)
// console.log(question)
// }
render() { render() {
if (this.state.page === 1) { if (this.state.page === 1) {
this.answerbox()
if (this.state.i === question.length) { if (this.state.i === question.length) {
return ( return (
<div> <div>
...@@ -43,8 +79,10 @@ class Quiz extends React.Component { ...@@ -43,8 +79,10 @@ class Quiz extends React.Component {
<h2>Q:{this.state.Q}</h2> <h2>Q:{this.state.Q}</h2>
{this.state.Choose.map((a) => {this.state.Choose.map((a) =>
<div> <div>
<input type="radio" name="a" id={a} value={a} /> <input type="radio" name='answer' id={a} value={a} /*ref={this.textInput}*/ />
<label for={a}>{a}</label> <label for={a}>{a}</label>
</div>)} </div>)}
<div className="App"> <div className="App">
정답을 입력하세요 정답을 입력하세요
...@@ -52,7 +90,7 @@ class Quiz extends React.Component { ...@@ -52,7 +90,7 @@ class Quiz extends React.Component {
{/* <div> {/* <div>
<input type="text" value={this.state.v} name="A" onChange={this.setAnswer} /> <input type="text" value={this.state.v} name="A" onChange={this.setAnswer} />
</div> */} </div> */}
<button type="button" onClick={this.setQuestion}>다음</button> <button type="button" onClick={setTimeout(this.setQuestion, 2000)}>다음</button>
</div> </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