Commit bf12e0b5 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

l

parent 475dd240
...@@ -6,9 +6,15 @@ let savechoose = {} ...@@ -6,9 +6,15 @@ let savechoose = {}
function AdminQuiz(props) { function AdminQuiz(props) {
const [question, setQuestion] = useState('') const [question, setQuestion] = useState(props.data.Q)
const [choose, setChoose] = useState('') // setQuestion(props.data.Q)
const [answer, setAnswer] = useState('') // question = props.data.Q
const [choose, setChoose] = useState(props.data.Choose)
// setChoose(props.data.Choose)
// choose = props.data.Choose
const [answer, setAnswer] = useState(props.data.A)
// setAnswer(props.data.A)
// answer = props.data.A
const [selectOption, setselectOption] = useState(1) const [selectOption, setselectOption] = useState(1)
...@@ -35,7 +41,7 @@ function AdminQuiz(props) { ...@@ -35,7 +41,7 @@ function AdminQuiz(props) {
<input type="radio" checked={false} name="answer" /> <input type="radio" checked={false} name="answer" />
</div> </div>
</div> </div>
<input type="text" class="form-control" id={String(selectOption + 1)} placeholder="보기를 입력하세요" onChange={handleChangeChoose} /> <input type="text" class="form-control" id={String(selectOption + 1)} value={choose[selectOption]} placeholder={(selectOption + 1) + '보기를 입력하세요'} onChange={handleChangeChoose} />
</div> </div>
) )
setselectOption(selectOption + 1) setselectOption(selectOption + 1)
...@@ -79,7 +85,7 @@ function AdminQuiz(props) { ...@@ -79,7 +85,7 @@ function AdminQuiz(props) {
<input type="radio" checked={false} name="answer" /> <input type="radio" checked={false} name="answer" />
</div> </div>
</div> </div>
<input type="text" className="form-control" id='1' placeholder="보기를 입력하세요" onChange={handleChangeChoose} /> <input type="text" className="form-control" id='1' value={choose} placeholder="보기를 입력하세요" onChange={handleChangeChoose} />
</div> </div>
{list.map((element) => element)} {list.map((element) => element)}
<button className="btn btn-outline-secondary btn-sm" onClick={addSelectOption}>+</button> <button className="btn btn-outline-secondary btn-sm" onClick={addSelectOption}>+</button>
......
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