Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021_123
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021_123
2021_123
Commits
56d8a255
Commit
56d8a255
authored
Nov 22, 2021
by
A.M.R.Y Bandara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Games leaderboard js file
parent
b71b4751
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
186 additions
and
0 deletions
+186
-0
leaderboard.js
leaderboard.js
+186
-0
No files found.
leaderboard.js
0 → 100644
View file @
56d8a255
import
React
,
{
Component
}
from
'
react
'
;
//import '../../../node_modules/bootstrap/dist/css/bootstrap.min.css';
import
Itemcard
from
"
./itemCard
"
;
import
data
from
"
./dietData
"
;
import
{
CartProvider
}
from
"
react-use-cart
"
;
import
Cart
from
'
./Cart
'
;
import
'
../home-components/App.css
'
;
import
axios
from
"
axios
"
;
import
Navbar
from
'
../global-components/navbar
'
;
import
Footer
from
'
../global-components/footer
'
;
import
{
Form
,
Col
,
Card
,
Table
,
Overlay
,
Modal
,
Dropdown
}
from
'
react-bootstrap
'
;
class
studentMarks
extends
Component
{
constructor
(
props
){
super
(
props
)
this
.
state
=
{
member
:
false
,
memberID
:
null
,
bmrVal
:
null
,
level1
:
[],
level2
:
[],
show
:
false
}
}
componentDidMount
(){
let
currentComponent
=
this
;
axios
.
get
(
'
http://127.0.0.1:5000/getData
'
,
{
params
:
{
type
:
"
Addition
"
}
}).
then
(
function
(
response
){
console
.
log
(
response
.
data
);
if
(
response
.
data
!=
null
){
currentComponent
.
setState
({
level1
:
response
.
data
[
"
level1
"
]})
currentComponent
.
setState
({
level2
:
response
.
data
[
"
level2
"
]})
currentComponent
.
setState
({
show
:
true
})
}
}).
catch
(
function
(
error
){
console
.
log
(
error
);
});
}
// handleInput = (event) => {
// this.setState({memberID:event.target.value})
// }
view
=
(
e
)
=>
{
let
currentComponent
=
this
;
axios
.
get
(
'
http://127.0.0.1:5000/getData
'
,
{
params
:
{
type
:
e
}
}).
then
(
function
(
response
){
console
.
log
(
response
.
data
);
if
(
response
.
data
!=
null
){
currentComponent
.
setState
({
level1
:
response
.
data
[
"
level1
"
]})
currentComponent
.
setState
({
level2
:
response
.
data
[
"
level2
"
]})
currentComponent
.
setState
({
show
:
true
})
}
}).
catch
(
function
(
error
){
console
.
log
(
error
);
});
}
// console.log(member)
render
()
{
const
rows
=
this
.
state
.
level1
;
const
rows2
=
this
.
state
.
level2
;
return
(
<>
<
Navbar
/>
<
div
className
=
"
nav2
"
>
<
button
onClick
=
{()
=>
this
.
view
(
"
Addition
"
)}
className
=
"
nav_link2
"
>
Addition
<
/button
>
<
button
onClick
=
{()
=>
this
.
view
(
"
Substraction
"
)}
className
=
"
nav_link2
"
>
Substraction
<
/button
>
<
button
onClick
=
{()
=>
this
.
view
(
"
Division
"
)}
className
=
"
nav_link2
"
>
Division
<
/button
>
<
button
onClick
=
{()
=>
this
.
view
(
"
Multiplication
"
)}
className
=
"
nav_link2
"
>
Multiplication
<
/button
>
<
/div
>
{
this
.
state
.
show
==
true
?
<
div
className
=
"
container
"
>
<
br
/>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-lg-9 col-md-8 col-sm-10 offset-lg-2 offset-md-2 offset-sm-1
"
>
<
div
className
=
"
section-title text-center mb60
"
>
<
h2
>
Level
01
<
/h2
>
<
hr
className
=
"
lines
"
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row align-items-center
"
>
<
table
id
=
"
question
"
>
<
thead
>
<
tr
>
<
th
>
<
/th
>
<
th
>
Username
<
/th
>
<
th
>
Score
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
>
{
rows
.
map
((
q
,
i
)
=>
(
<
tr
>
<
td
>
{
i
+
1
}
<
/td
>
<
td
>
{
q
[
0
]}
<
/td
>
<
td
>
{
q
[
1
]}
<
/td
>
<
/tr
>
))
}
<
/tbody
>
<
/table
>
<
br
/>
<
br
/>
<
br
/>
<
/div
>
<
br
/>
<
br
/>
<
br
/>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-lg-9 col-md-8 col-sm-10 offset-lg-2 offset-md-2 offset-sm-1
"
>
<
div
className
=
"
section-title text-center mb60
"
>
<
h2
>
Level
02
<
/h2
>
<
hr
className
=
"
lines
"
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row align-items-center
"
>
<
table
id
=
"
question
"
>
<
thead
>
<
tr
>
<
th
>
<
/th
>
<
th
>
Username
<
/th
>
<
th
>
Score
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
>
{
rows2
.
map
((
q
,
i
)
=>
(
<
tr
>
<
td
>
{
i
+
1
}
<
/td
>
<
td
>
{
q
[
0
]}
<
/td
>
<
td
>
{
q
[
1
]}
<
/td
>
<
/tr
>
))
}
<
/tbody
>
<
/table
>
<
br
/>
<
br
/>
<
br
/>
<
br
/>
<
br
/>
<
br
/>
<
br
/>
<
/div
>
<
/div
>
:
null
}
<
Footer
/>
<
/
>
);
}
}
export
default
studentMarks
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