Commit 60d232d8 authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

asd

parent befbdcdb
...@@ -6,7 +6,7 @@ let list = [] ...@@ -6,7 +6,7 @@ let list = []
let QnAadmins = [] let QnAadmins = []
let QnAadmin = {} let QnAadmin = {}
let c = {} let savechoose = {}
function AdminQuiz(props) { function AdminQuiz(props) {
...@@ -24,7 +24,7 @@ function AdminQuiz(props) { ...@@ -24,7 +24,7 @@ function AdminQuiz(props) {
setQuestion(event.target.value) setQuestion(event.target.value)
} }
const handleChangeChoose = (event) => { const handleChangeChoose = (event) => {
c[event.target.id] = event.target.value savechoose[event.target.id] = event.target.value
// QnAadmin['Choose'] = event.target.value // QnAadmin['Choose'] = event.target.value
...@@ -37,8 +37,6 @@ function AdminQuiz(props) { ...@@ -37,8 +37,6 @@ function AdminQuiz(props) {
setAnswer(event.target.value) setAnswer(event.target.value)
} }
function addSelectOption() { function addSelectOption() {
list.push( list.push(
<div className="input-group"> <div className="input-group">
...@@ -65,12 +63,10 @@ function AdminQuiz(props) { ...@@ -65,12 +63,10 @@ function AdminQuiz(props) {
alert('정답이 입력되지 않았습니다.') alert('정답이 입력되지 않았습니다.')
} }
else { else {
// let data = localStorage.getItem('QnA')
// data=data?JSON.parse(data):''
// QnAadmins.push(data)
console.log(QnAadmin) console.log(QnAadmin)
QnAadmin['Choose'] = Object.values(c) QnAadmin['Choose']=Object.values(savechoose)
QnAadmins.push(QnAadmin) QnAadmins.push(QnAadmin)
QnAadmin = {}
localStorage.setItem('QnA', JSON.stringify(QnAadmins)) localStorage.setItem('QnA', JSON.stringify(QnAadmins))
console.log(QnAadmins) console.log(QnAadmins)
alert('입력이 완료되었습니다.') alert('입력이 완료되었습니다.')
......
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