Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이수빈
/
Find_your_own_personal_color
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이수빈
2020-12-01 20:11:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7121c6f8f7d7d8a9ec9148e6bc47252c1f23db9c
7121c6f8
1 parent
f3e733be
test3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
19 deletions
front/.eslintcache
front/src/test.js
front/.eslintcache
View file @
7121c6f
[{"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js":"1","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js":"2","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js":"3","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js":"4"},{"size":450,"mtime":1606585705558,"results":"5","hashOfConfig":"6"},{"size":493,"mtime":1606590087333,"results":"7","hashOfConfig":"6"},{"size":2628,"mtime":1606613746724,"results":"8","hashOfConfig":"6"},{"size":238,"mtime":1606589880919,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pqxpq",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js",[]]
\ No newline at end of file
[{"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js":"1","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js":"2","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js":"3","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js":"4"},{"size":450,"mtime":1606585705558,"results":"5","hashOfConfig":"6"},{"size":493,"mtime":1606590087333,"results":"7","hashOfConfig":"6"},{"size":2796,"mtime":1606623443075,"results":"8","hashOfConfig":"6"},{"size":238,"mtime":1606589880919,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pqxpq",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js",[]]
\ No newline at end of file
...
...
front/src/test.js
View file @
7121c6f
...
...
@@ -45,40 +45,47 @@ const Test = ( { history } ) =>
const
handleAnswerOptionClick
=
(
isCorrect
)
=>
{
if
(
isCorrect
)
{
setScore_cool
(
score_c
+
1
);
//c,c,w,w
handlePersonalScore
(
score_c
,
score_w
);
}
else
{
setScore_warm
(
score_w
+
1
);
setScore_warm
(
score_w
+
1
);
handlePersonalScore
(
score_c
,
score_w
);
}
const
nextQuestion
=
currentQuestion
+
1
;
if
(
nextQuestion
<
questions
.
length
)
{
setCurrentQuestion
(
nextQuestion
);
//0,0 -> 0,1 -> 1,2 -> 2,3
}
else
if
(
nextQuestion
===
questions
.
length
){
if
(
score_c
>
score_w
){
setPersonal
(
'cool'
);
}
else
if
(
score_c
<
score_w
){
setPersonal
(
'warm'
);
}
else
{
setPersonal
(
'restart'
);
}
isTrue
=
1
;
handlePersonalScore
(
score_c
,
score_w
);
}
if
(
isTrue
===
1
)
{
setShowScore
(
true
);
else
{
isTrue
=
1
;
if
(
isTrue
===
1
)
{
setShowScore
(
true
);
}
}
};
const
handlePersonalScore
=
(
score_c
,
score_w
)
=>
{
if
(
score_c
>
score_w
){
setPersonal
(
'cool'
);
}
else
if
(
score_c
<
score_w
){
setPersonal
(
'warm'
);
}
else
{
setPersonal
(
'restart'
);
}
}
return
(
<
div
className
=
'app'
>
{
showScore
?
(
<
span
className
=
'score-section'
>
You
scored
{
currentQuestion
}{
questions
.
length
}{
score
}
out
of
{
questions
.
length
}
You
scored
{
score_c
}{
score_w
}{
score
}
out
of
{
questions
.
length
}
<
/span
>
)
:
(
<>
...
...
Please
register
or
login
to post a comment