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
Show whitespace changes
Inline
Side-by-side
src/End.js
View file @
1b072faf
...
@@ -5,21 +5,22 @@ import tr from './img_end.jpg';
...
@@ -5,21 +5,22 @@ import tr from './img_end.jpg';
// import { Link } from 'react-router-dom';
// import { Link } from 'react-router-dom';
function
End
()
{
function
End
()
{
let
Scores
=
[]
let
scores
=
[]
let
Score
=
0
let
score
=
0
JSON
.
parse
(
localStorage
.
getItem
(
'
Answers
'
))
const
answers
=
JSON
.
parse
(
localStorage
.
getItem
(
'
Answers
'
))
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
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
{
else
{
S
cores
[
i
]
=
0
s
cores
[
i
]
=
0
}
}
S
core
+=
S
cores
[
i
]
s
core
+=
s
cores
[
i
]
}
}
return
(
return
(
...
@@ -30,17 +31,17 @@ function End() {
...
@@ -30,17 +31,17 @@ function End() {
<
div
className
=
'
card-body
'
>
<
div
className
=
'
card-body
'
>
<
h3
className
=
'
card-title
'
>
이름
:
{
localStorage
.
getItem
(
'
name
'
)}
<
/h3
>
<
h3
className
=
'
card-title
'
>
이름
:
{
localStorage
.
getItem
(
'
name
'
)}
<
/h3
>
{
S
cores
.
map
(
score
=>
{
{
s
cores
.
map
(
(
score
,
index
)
=>
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
if
(
score
===
1
)
{
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
>
<
div
style
=
{{
marginTop
:
'
100px
'
}}
className
=
"
Box text-center
"
>
<
div
style
=
{{
marginTop
:
'
100px
'
}}
className
=
"
Box text-center
"
>
<
img
src
=
{
tr
}
alt
=
"
수고
"
/>
<
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