Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
online-quiz-react
Commits
0b337dae
Commit
0b337dae
authored
Aug 12, 2020
by
baesangjune
Browse files
.
parent
5d9b4992
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Admin.js
View file @
0b337dae
...
@@ -2,12 +2,6 @@ import React, { useState } from 'react';
...
@@ -2,12 +2,6 @@ import React, { useState } from 'react';
import
AdminQuiz
from
'
./AdminQuiz
'
import
AdminQuiz
from
'
./AdminQuiz
'
import
AdminSetting
from
'
./AdminSetting
'
import
AdminSetting
from
'
./AdminSetting
'
// let QnAadmins = []
// let QnAadmin = {}
// let Setadmins = []
// let Setadmin = {}
let
QuizBtn
=
[]
let
QuizBtn
=
[]
function
Admin
()
{
function
Admin
()
{
...
@@ -30,110 +24,6 @@ function Admin() {
...
@@ -30,110 +24,6 @@ function Admin() {
setQuizBtnCount
(
QuizBtnCount
+
1
)
setQuizBtnCount
(
QuizBtnCount
+
1
)
}
}
// const [question, setQuestion] = useState('')
// const [choose, setChoose] = useState('')
// const [answer, setAnswer] = useState('')
// const [password, setPassword] = useState('')
// const [adminpassword, setAdminPassword] = useState('')
// const [time, setTime] = useState('')
// const [addQuiz, setaddQuiz] = useState('')
// const [selectOption, setselectOption] = useState('')
// const handleChangeQuestion = (event) => {
// QnAadmin['Q'] = event.target.value
// setQuestion(event.target.value)
// }
// const handleChangechoose = (event) => {
// QnAadmin['Choose'] = event.target.value
// setChoose(event.target.value)
// }
// const handleChangeanswer = (event) => {
// QnAadmin['A'] = event.target.value
// setAnswer(event.target.value)
// }
// const handleChangePassword = (event) => {
// Setadmin['password'] = event.target.value
// setPassword(event.target.value)
// }
// const handleChangeAdminPassword = (event) => {
// Setadmin['AdminPassword'] = event.target.value
// setAdminPassword(event.target.value)
// }
// const handleChangeTime = (event) => {
// Setadmin['Time'] = event.target.value
// setTime(event.target.value)
// }
// function handleClickQnA() {
// if (!question) {
// alert('문제가 입력되지 않았습니다.')
// }
// else if (!choose) {
// alert('보기가 입력되지 않았습니다.')
// }
// else if (!answer) {
// alert('정답이 입력되지 않았습니다.')
// }
// else {
// console.log(QnAadmin)
// QnAadmins.push(QnAadmin)
// localStorage.setItem('QnA', JSON.stringify(QnAadmins))
// console.log(QnAadmins)
// alert('입력이 완료되었습니다.')
// }
// }
// function handleClicksetting() {
// if (!password) {
// alert('비밀번호가 입력되지 않았습니다.')
// }
// else if (!adminpassword) {
// alert('관리자 비밀번호가 입력되지 않았습니다.')
// }
// else if (!time) {
// alert('제한시간이 입력되지 않았습니다.') //타임은 조건은 빼도 될 듯
// }
// else {
// Setadmins.push(Setadmin)
// localStorage.setItem('Set', JSON.stringify(Setadmins))
// console.log(Setadmins)
// alert('저장이 완료되었습니다.')
// console.log(Setadmin)
// // setDoneset(true)
// }
// }
// function addSelectOption() {
// let list = function () {
// return <div className="input-group">
// <div className="input-group-prepend">
// <div className="input-group-text">
// <input type="radio" id="option" />
// </div>
// </div>
// <input type="text" className="form-control" placeholder="보기를 입력하세요" onChange={handleChangechoose} />
// </div>
// }
// setselectOption(list)
// // }
// function handleClickQuiz() {
// let addQuiz = function () {
// return <a className="nav-link" id="Quiz4-tab" data-toggle="pill" href="#Quiz" role="tab" >Quiz4</a>
// }
// setaddQuiz(addQuiz)
// }
return
(
return
(
<>
<>
<
div
className
=
"
container-fluid
"
>
<
div
className
=
"
container-fluid
"
>
...
...
src/AdminQuiz.js
View file @
0b337dae
...
@@ -4,7 +4,7 @@ let list = []
...
@@ -4,7 +4,7 @@ let list = []
let
QnAadmins
=
[]
let
QnAadmins
=
[]
let
QnAadmin
=
{}
let
QnAadmin
=
{}
let
c
=
{}
let
savechoose
=
{}
function
AdminQuiz
()
{
function
AdminQuiz
()
{
...
@@ -21,8 +21,8 @@ function AdminQuiz() {
...
@@ -21,8 +21,8 @@ function AdminQuiz() {
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
setChoose
(
event
.
target
.
value
)
setChoose
(
event
.
target
.
value
)
}
}
...
@@ -62,7 +62,7 @@ function AdminQuiz() {
...
@@ -62,7 +62,7 @@ function AdminQuiz() {
}
}
else
{
else
{
console
.
log
(
QnAadmin
)
console
.
log
(
QnAadmin
)
QnAadmin
[
'
Choose
'
]
=
Object
.
values
(
c
)
QnAadmin
[
'
Choose
'
]
=
Object
.
values
(
savechoose
)
QnAadmins
.
push
(
QnAadmin
)
QnAadmins
.
push
(
QnAadmin
)
QnAadmin
=
{}
QnAadmin
=
{}
localStorage
.
setItem
(
'
QnA
'
,
JSON
.
stringify
(
QnAadmins
))
localStorage
.
setItem
(
'
QnA
'
,
JSON
.
stringify
(
QnAadmins
))
...
...
src/AdminSetting.js
View file @
0b337dae
...
@@ -43,7 +43,6 @@ function AdminSetting() {
...
@@ -43,7 +43,6 @@ function AdminSetting() {
alert
(
'
저장이 완료되었습니다.
'
)
alert
(
'
저장이 완료되었습니다.
'
)
console
.
log
(
Setadmin
)
console
.
log
(
Setadmin
)
// setDoneset(true)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment