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
bf12e0b5
Commit
bf12e0b5
authored
Aug 17, 2020
by
Jiwon Yoon
Browse files
l
parent
475dd240
Changes
1
Show whitespace changes
Inline
Side-by-side
src/AdminQuiz.js
View file @
bf12e0b5
...
...
@@ -6,9 +6,15 @@ let savechoose = {}
function
AdminQuiz
(
props
)
{
const
[
question
,
setQuestion
]
=
useState
(
''
)
const
[
choose
,
setChoose
]
=
useState
(
''
)
const
[
answer
,
setAnswer
]
=
useState
(
''
)
const
[
question
,
setQuestion
]
=
useState
(
props
.
data
.
Q
)
// setQuestion(props.data.Q)
// 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
)
...
...
@@ -35,7 +41,7 @@ function AdminQuiz(props) {
<
input
type
=
"
radio
"
checked
=
{
false
}
name
=
"
answer
"
/>
<
/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
>
)
setselectOption
(
selectOption
+
1
)
...
...
@@ -79,7 +85,7 @@ function AdminQuiz(props) {
<
input
type
=
"
radio
"
checked
=
{
false
}
name
=
"
answer
"
/>
<
/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
>
{
list
.
map
((
element
)
=>
element
)}
<
button
className
=
"
btn btn-outline-secondary btn-sm
"
onClick
=
{
addSelectOption
}
>+<
/button
>
...
...
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