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
96ab4893
Commit
96ab4893
authored
Aug 12, 2020
by
Jiwon Yoon
Browse files
Merge branch 'Sangjune' into jiwon
parents
da897cd7
e4f2db26
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Admin.js
View file @
96ab4893
...
...
@@ -9,11 +9,11 @@ let QuizBtn = []
function
Admin
()
{
let
QnAadmins
=
[]
let
QnAadmin
=
{}
// let QnAadmin = []
// let Q = []
// let choose = []
// let N = []
let
Setadmins
=
[]
let
Setadmin
=
{}
const
[
result
,
setresult
]
=
useState
(
''
)
// const [addQuiz, setaddQuiz] = useState('')
...
...
src/Quiz.js
View file @
96ab4893
...
...
@@ -16,16 +16,14 @@ localStorage.setItem('Solutions', JSON.stringify(Solutions))
function
Quiz
()
{
const
[
question
,
setQuestion
]
=
useState
({
...
QnA
[
0
],
i
:
0
,
page
:
0
,
...
QnA
[
0
]
})
const
[
selected
,
setSelected
]
=
useState
(
""
)
//선택한 답을 보여줄 것
const
[
timeout
,
settimeout
]
=
useState
(
false
)
function
handleQuestion
()
{
setQuestion
({
...
QnA
[
question
.
i
+
1
],
i
:
question
.
i
+
1
,
page
:
question
.
page
+
1
})
setQuestion
({
...
QnA
[
question
.
N
]
})
setSelected
(
""
)
//페이지 넘어가면 selected 초기화
}
...
...
@@ -59,7 +57,7 @@ function Quiz() {
<
/form
>
<
span
className
=
"
h5 font-weight-bold
"
>
Your
Answer
:
<
/span
>
<
span
className
=
"
h2 font-weight-bold text-danger
"
>
{
selected
}
<
/span> {/
*
선택한
값
보여줌
*
/
}
<
div
className
=
"
text-center my-3
"
>
{(
question
.
page
===
QnA
.
length
-
1
)
<
div
className
=
"
text-center my-3
"
>
{(
question
.
N
-
1
===
QnA
.
length
-
1
)
?
<
Link
to
=
"
/end
"
>
<
button
className
=
"
btn btn-outline-success
"
onClick
=
{
localStorage
.
setItem
(
'
Solutions
'
,
JSON
.
stringify
(
Solutions
))}
>
제출
<
/button
>
<
/Link
>
...
...
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