Roller
diff --git a/src/components/event-description-board.vue b/src/components/event-description-board.vue
index d08cfa3..b91aa34 100644
--- a/src/components/event-description-board.vue
+++ b/src/components/event-description-board.vue
@@ -1,25 +1,61 @@
-
-
-
+
+
+{score=s}">
-
+
-
+
@@ -51,7 +87,7 @@ function getStuInfo()
grid-template-columns:27.3% 52.37% 20.33%;
flex-direction: row;
width: 100%;
- background-color: #7B8795;
+ background-color: #657A7E;
}
.score-board {
margin: 11.39vh 0 0 40.26%;
diff --git a/src/components/menu-sidebar.vue b/src/components/menu-sidebar.vue
deleted file mode 100644
index ed49278..0000000
--- a/src/components/menu-sidebar.vue
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/upload-panel.vue b/src/components/upload-panel.vue
new file mode 100644
index 0000000..2af8b6f
--- /dev/null
+++ b/src/components/upload-panel.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/main-frame.vue b/src/components/main-frame.vue
index ed81885..a5993bd 100644
--- a/src/components/main-frame.vue
+++ b/src/components/main-frame.vue
@@ -5,13 +5,31 @@ import {ref} from "vue";
import EventDescriptionBoard from "./event-description-board.vue";
const number=ref(0);
const enable=ref(false);
-const score=ref(0);
+const score=ref(0.0);
const sno=ref("");
const sname=ref("");
-function getStuInfo()
+const eventID=ref(0);
+const eventDescription=ref("")
+let init=false;
+let score_variation = 0.0;
+function start()
{
- let res = fetch("http://127.0.0.1:8000/get_random_stu",{method: "GET"});
- res.then((res)=>{
+ if(init)
+ {
+ fetch("http://localhost:8000/api/post/update_score",{
+ method: "POST",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ sno: sno.value,
+ variation: score.value - score_variation})
+ })
+ }
+ init=true;
+ fetch("http://127.0.0.1:8000/api/get/get_random_stu",{method: "GET"})
+ .then((res)=>{
return res.json()
}).then((data)=>{
// noinspection JSUnresolvedReference
@@ -19,6 +37,24 @@ function getStuInfo()
// noinspection JSUnresolvedReference
sname.value = data.sname
})
+ fetch("http://localhost:8000/api/get/get_random_event",{method: "GET"})
+ .then((res)=>{
+ return res.json()
+ }).then((data)=>{
+ // noinspection JSUnresolvedReference
+ eventID.value = data.event_id
+ enable.value = eventID.value !== 0;
+ // noinspection JSUnresolvedReference
+ eventDescription.value = data.event_description
+ })
+ switch (eventID.value) {
+ case 1:
+ score_variation = 1;
+ break;
+ case 2:
+ score_variation = -0.5;
+ break;
+ }
}
@@ -27,9 +63,9 @@ function getStuInfo()
+ event
description +
+ description +
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/javascript/main-menu.js b/src/javascript/main-menu.js
index 223cc35..396043d 100644
--- a/src/javascript/main-menu.js
+++ b/src/javascript/main-menu.js
@@ -1,5 +1,5 @@
import { createApp } from 'vue'
-import MenuSidebar from '../components/menu-sidebar.vue'
+import MenuSidebar from '../components/upload-panel.vue'
const app = createApp(MenuSidebar)
app.mount('#menu-sidebar')
\ No newline at end of file