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
e67f66d7
Commit
e67f66d7
authored
Aug 12, 2020
by
Jiwon Yoon
Browse files
a
parent
0cb9f458
Changes
1
Show whitespace changes
Inline
Side-by-side
src/Admin.js
View file @
e67f66d7
import
React
,
{
useState
}
from
'
react
'
;
import
AdminQuiz
from
'
./AdminQuiz
'
;
import
AdminQuiz
from
'
./AdminQuiz
'
import
AdminSetting
from
'
./AdminSetting
'
// import { Link } from 'react-router-dom';
let
QuizBtn
=
[]
let
QuizBtn
=
[]
function
Admin
()
{
const
[
result
,
setresult
]
=
useState
(
''
)
const
[
QuizBtnCount
,
setQuizBtnCount
]
=
useState
(
4
)
const
[
result
,
setresult
]
=
useState
(
''
)
// const [addQuiz, setaddQuiz] = useState('')
const
[
QuizBtnCount
,
setQuizBtnCount
]
=
useState
(
4
)
function
handleClickSetting
()
{
setresult
(
<
AdminSetting
/>
)
function
handleClickSetting
(){
setresult
(
<
AdminSetting
/>
)
}
function
handleClickQuiz
()
{
setresult
(
<
AdminQuiz
/>
)
function
handleClickQuiz
(){
setresult
(
<
AdminQuiz
/>
)
}
function
handleClickAddQuiz
()
{
QuizBtn
.
push
(
<
button
type
=
"
button
"
className
=
"
btn btn-outline-primary
"
id
=
{
QuizBtnCount
}
onClick
=
{
handleClickQuiz
}
>
Quiz
{
QuizBtnCount
}
<
/button
>
function
handleClickAddQuiz
(){
QuizBtn
Count
.
push
(
<
button
type
=
'
button
'
className
=
'
btn btn-outline-primary
'
id
=
{
QuizBtnCount
}
onClick
=
{
handleClickQuiz
}
>
Quiz
{
QuizBtnCount
}
<
/button
>
)
setQuizBtnCount
(
QuizBtnCount
+
1
)
setQuizBtnCount
(
QuizBtnCount
+
1
)
}
return
(
...
...
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