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
49dad3a0
Commit
49dad3a0
authored
Aug 17, 2020
by
baesangjune
Browse files
.
parent
7fbe9b17
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AdminQuiz.js
View file @
49dad3a0
...
@@ -18,6 +18,17 @@ function AdminQuiz(props) {
...
@@ -18,6 +18,17 @@ function AdminQuiz(props) {
// answer = props.data.A
// answer = props.data.A
const
[
selectOption
,
setselectOption
]
=
useState
(
1
)
const
[
selectOption
,
setselectOption
]
=
useState
(
1
)
// 만약 업데이트가 되었으면 question이랑 props.data.Q랑 값이 같아야 하는데
// admin페이지 가서 quiz 1에 값들 넣은 다음 콘솔찍어보고 quiz 2에도 값을 넣고 콘솔보면 어떤게 다른지 알 수 있을거야
// 마지막으로 quiz3 눌러보면 확실하게 알 수 있을거고 값이 처음만 업데이트되고 나중에는 업데이트가 안되고있어
console
.
log
(
question
)
console
.
log
(
props
.
data
.
Q
)
console
.
log
(
choose
)
console
.
log
(
props
.
data
.
Choose
)
console
.
log
(
answer
)
console
.
log
(
props
.
data
.
A
)
const
handleChangeQuestion
=
(
event
)
=>
{
const
handleChangeQuestion
=
(
event
)
=>
{
QnAadmin
[
'
Q
'
]
=
event
.
target
.
value
QnAadmin
[
'
Q
'
]
=
event
.
target
.
value
setQuestion
(
event
.
target
.
value
)
setQuestion
(
event
.
target
.
value
)
...
@@ -73,40 +84,40 @@ function AdminQuiz(props) {
...
@@ -73,40 +84,40 @@ function AdminQuiz(props) {
return
(
return
(
<>
<>
<
div
className
=
""
id
=
"
Quiz1
"
>
<
div
className
=
""
id
=
"
Quiz1
"
>
<
h2
className
=
"
p-3 border text-center
"
>
{
String
(
props
.
QuizNum
)}
번
문제만들기
<
/h2
>
<
h2
className
=
"
p-3 border text-center
"
>
{
String
(
props
.
QuizNum
)}
번
문제만들기
<
/h2
>
<
div
className
=
"
p-3 borber
"
>
<
div
className
=
"
p-3 borber
"
>
<
div
className
=
"
p-3
"
>
<
div
className
=
"
p-3
"
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
1
.
문제
입력하기
<
/span
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
1
.
문제
입력하기
<
/span
>
<
input
type
=
"
text
"
id
=
"
inputQuiz
"
className
=
"
form-control
"
onChange
=
{
handleChangeQuestion
}
value
=
{
question
}
placeholder
=
{
'
문제를 입력하세요
'
}
><
/input
>
<
input
type
=
"
text
"
id
=
"
inputQuiz
"
className
=
"
form-control
"
onChange
=
{
handleChangeQuestion
}
value
=
{
question
}
placeholder
=
{
'
문제를 입력하세요
'
}
><
/input
>
<
/div
>
<
/div
>
<
div
className
=
"
p-3
"
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
2
.
보기
입력하기
<
/span
>
<
div
className
=
"
p-3
"
>
<
div
className
=
"
p-3
"
>
<
div
className
=
"
input-group
"
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
2
.
보기
입력하기
<
/span
>
<
div
className
=
"
input-group-prepend
"
>
<
div
className
=
"
p-3
"
>
<
div
className
=
"
input-group-text
"
>
<
div
className
=
"
input-group
"
>
<
input
type
=
"
radio
"
checked
=
{
false
}
name
=
"
answer
"
/>
<
div
className
=
"
input-group-prepend
"
>
<
div
className
=
"
input-group-text
"
>
<
input
type
=
"
radio
"
checked
=
{
false
}
name
=
"
answer
"
/>
<
/div
>
<
/div
>
<
/div
>
<
input
type
=
"
text
"
className
=
"
form-control
"
id
=
'
1
'
value
=
{
choose
}
placeholder
=
{
'
1번 보기를 입력하세요
'
}
onChange
=
{
handleChangeChoose
}
/
>
<
/div
>
<
/div
>
<
input
type
=
"
text
"
className
=
"
form-control
"
id
=
'
1
'
value
=
{
choose
}
placeholder
=
{
'
1번 보기를 입력하세요
'
}
onChange
=
{
handleChangeChoose
}
/
>
{
list
.
map
((
element
)
=>
element
)}
<
button
className
=
"
btn btn-outline-secondary btn-sm
"
onClick
=
{
addSelectOption
}
>+<
/button
>
<
/div
>
<
/div
>
{
list
.
map
((
element
)
=>
element
)}
<
button
className
=
"
btn btn-outline-secondary btn-sm
"
onClick
=
{
addSelectOption
}
>+<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
p-3
"
>
<
div
className
=
"
p-3
"
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
정답
:
<
/span
>
<
span
className
=
"
font-weight-bold mr-2 h3
"
>
정답
:
<
/span
>
<
input
type
=
"
text
"
onChange
=
{
handleChangeanswer
}
value
=
{
answer
}
placeholder
=
{
'
정답를 입력하세요
'
}
/
>
<
input
type
=
"
text
"
onChange
=
{
handleChangeanswer
}
value
=
{
answer
}
placeholder
=
{
'
정답를 입력하세요
'
}
/
>
<
/div
>
<
/div
>
<
label
for
=
"
inputLogin
"
className
=
"
d-flex justify-content-center
"
>
<
label
for
=
"
inputLogin
"
className
=
"
d-flex justify-content-center
"
>
<
button
className
=
"
mt-4 btn btn-dark
"
onClick
=
{
handleClick
}
>
작성완료
<
/button
>
<
button
className
=
"
mt-4 btn btn-dark
"
onClick
=
{
handleClick
}
>
작성완료
<
/button
>
<
/label
>
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
>
<
/
>
)
)
}
}
...
...
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