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
5f3cac18
Commit
5f3cac18
authored
Jul 29, 2020
by
baesangjune
Browse files
check
parent
7306d873
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Home.js
View file @
5f3cac18
...
...
@@ -17,7 +17,7 @@ function Home() {
<
div
className
=
'
Box2
'
>
<
Link
to
=
"
/quiz
"
>
<
button
className
=
"
QuizStart
"
>
Quiz
Start
!<
/button
>
<
button
className
=
"
QuizStart
"
onClick
=
{
checking
}
>
Quiz
Start
!<
/button
>
<
/Link
>
<
/div
>
<
/
>
...
...
@@ -26,7 +26,7 @@ function Home() {
}
function
checking
(
event
)
{
if
(
sessionStorage
.
getItem
(
'
name
'
)
===
null
||
''
)
{
if
(
sessionStorage
.
getItem
(
'
name
'
)
===
null
||
sessionStorage
.
getItem
(
'
name
'
).
length
===
0
)
{
alert
(
'
이름을 입력하세요
'
)
// alert('입력하신 이름은'+event.target+'입니다.')
...
...
src/Quiz.js
View file @
5f3cac18
...
...
@@ -13,6 +13,7 @@ class Quiz extends React.Component {
super
(
props
)
this
.
setQuestion
=
this
.
setQuestion
.
bind
(
this
)
this
.
answerbox
=
this
.
answerbox
.
bind
(
this
)
this
.
timer
=
this
.
timer
.
bind
(
this
)
// this.enterkey = this.enterkey(this)
this
.
state
=
{
...
question
[
0
],
...
...
@@ -40,6 +41,27 @@ class Quiz extends React.Component {
}
}
}
timer
(){
return
(
<
Timer
initialTime
=
{
10010
}
direction
=
"
backward
"
checkpoints
=
{[
{
time
:
0
,
callback
:
this
.
setQuestion
// history.go(1)
}
]}
>
{()
=>
(
<>
<
Timer
.
Seconds
/>
seconds
<
/
>
)}
<
/Timer> /
*
npm
i
react
-
compound
-
timer
*
/
)
}
// enterkey() {
// if ( window.event === 13 ) {
// alert("Enter Key 입력 감지 \n함수 실행.");
...
...
@@ -71,23 +93,7 @@ class Quiz extends React.Component {
}
{
/* <input onKeyPress="this.enterkey()"/> */
}
<
Timer
initialTime
=
{
5000
}
direction
=
"
backward
"
checkpoints
=
{[
{
time
:
0
,
callback
:
()
=>
console
.
log
(
'
콜백실행
'
)
// history.go(1)
}
]}
>
{()
=>
(
<>
<
Timer
.
Seconds
/>
seconds
<
/
>
)}
<
/Timer> {/
*
npm
i
react
-
compound
-
timer
*
/
}
{
this
.
timer
()}
<
/div
>
)
...
...
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