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
1b072faf
Commit
1b072faf
authored
Aug 05, 2020
by
baesangjune
Browse files
end 수정
parent
d809327d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/End.js
View file @
1b072faf
...
...
@@ -5,21 +5,22 @@ import tr from './img_end.jpg';
// import { Link } from 'react-router-dom';
function
End
()
{
let
Scores
=
[]
let
Score
=
0
JSON
.
parse
(
localStorage
.
getItem
(
'
Answers
'
))
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
let
scores
=
[]
let
score
=
0
const
answers
=
JSON
.
parse
(
localStorage
.
getItem
(
'
Answers
'
))
const
solutions
=
JSON
.
parse
(
localStorage
.
getItem
(
'
Solutions
'
))
for
(
let
i
=
0
;
i
<
answers
.
length
;
i
++
)
{
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'
A
nswers
'
))
[
i
]
===
JSON
.
parse
(
localStorage
.
getItem
(
'
S
olutions
'
))
[
i
])
{
if
(
a
nswers
[
i
]
===
s
olutions
[
i
])
{
S
cores
[
i
]
=
1
s
cores
[
i
]
=
1
}
else
{
S
cores
[
i
]
=
0
s
cores
[
i
]
=
0
}
S
core
+=
S
cores
[
i
]
s
core
+=
s
cores
[
i
]
}
return
(
...
...
@@ -30,17 +31,17 @@ function End() {
<
div
className
=
'
card-body
'
>
<
h3
className
=
'
card-title
'
>
이름
:
{
localStorage
.
getItem
(
'
name
'
)}
<
/h3
>
{
S
cores
.
map
(
score
=>
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
{
s
cores
.
map
(
(
score
,
index
)
=>
{
if
(
score
===
1
)
{
return
<
p
className
=
'
card-text
'
>
Quiz
{
(
i
+
1
)
}
:
'
O
'
<
/p
>
return
<
p
className
=
'
card-text
'
>
Quiz
{
index
+
1
}
:
'
O
'
<
/p
>
}
else
{
return
<
p
className
=
'
card-text
'
>
Quiz
{
(
i
+
1
)
}
:
'
X
'
<
/p>
}
else
{
return
<
p
className
=
'
card-text
'
>
Quiz
{
index
+
1
}
:
'
X
'
<
/p>
}
}
})}
<
p
className
=
'
card-text
'
>
Total
Score
:
{
S
core
}
<
/p
>
<
p
className
=
'
card-text
'
>
Total
Score
:
{
s
core
}
<
/p
>
<
/div
>
<
div
style
=
{{
marginTop
:
'
100px
'
}}
className
=
"
Box text-center
"
>
<
img
src
=
{
tr
}
alt
=
"
수고
"
/>
...
...
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