@@ -191,19 +227,19 @@ function Operation1() {
选择题:
{Object.keys(TrainData['operateID'][0]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
填空题:
{Object.keys(TrainData['operateID'][1]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
判断题:
{Object.keys(TrainData['operateID'][2]).map((key,index)=>(
-
{index+1} |
+ {index+1} |
))}
}
diff --git a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
index 8f813df..cc6ea96 100755
--- a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
+++ b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx
@@ -11,6 +11,10 @@ const list4=[
// 首页 学习分析
function SubjectPage(){
const student_ID=localStorage.getItem('islogin')
+ if(student_ID==null){
+ alert('登录过期,请重新登录')
+ window.location.href='http://36.138.114.105:30294/'
+ }
const [title,setTitle]=useState()
// 获取实训标题
const FetchTrainFunc=async()=>{
diff --git a/app-dm/src/pages/SighUp/SignUpForm.jsx b/app-dm/src/pages/SighUp/SignUpForm.jsx
index a822c17..27d6d93 100644
--- a/app-dm/src/pages/SighUp/SignUpForm.jsx
+++ b/app-dm/src/pages/SighUp/SignUpForm.jsx
@@ -72,7 +72,7 @@ import axios from 'axios';
const register_data=register_func.data
if (register_data.result==='注册成功'){
alert('注册成功')
- window.location.href='http://localhost:3000/signin'
+ window.location.href='http://36.138.114.105:30294/'
}else if(register_data.result==='注册失败'){
alert('账号已存在')
}
diff --git a/app-dm/src/setupProxy.js b/app-dm/src/setupProxy.js
index 8a77b83..4a40b4f 100644
--- a/app-dm/src/setupProxy.js
+++ b/app-dm/src/setupProxy.js
@@ -7,5 +7,5 @@ module.exports = function(app) {
target: 'http://127.0.0.1:5000', // 目标后端服务地址
changeOrigin: true,
})
- );
+ );
};
\ No newline at end of file
diff --git a/python/app.py b/python/app.py
index 8be6d84..4dedab1 100644
--- a/python/app.py
+++ b/python/app.py
@@ -230,6 +230,13 @@ def SendTrainTest():
SendTrainTestFunc(TrainChoice, TrainCompletion, TrainJudge, Hour, Min, StopTime,Class,Train,teacher_id)
return '发布成功'
+
+@app.route('/api/Find_details',methods=["POST"])
+def Find_details():
+ id=request.json['student_ID']
+ return Find_details(id)
+
+
@app.route('/')
@app.route('/
')
def catch_all(path = "index.html"):
diff --git a/python/student_func.py b/python/student_func.py
index aaaf9bb..6eea386 100644
--- a/python/student_func.py
+++ b/python/student_func.py
@@ -190,7 +190,6 @@ def find_end_test(ID):
TEST_ID = cursor.fetchall()
for i in TEST_ID:
testID.append(i[0])
- print(i)
return testID
# find_end_test('20240101')
diff --git a/python/teacher_func.py b/python/teacher_func.py
index 21ef154..10e6516 100644
--- a/python/teacher_func.py
+++ b/python/teacher_func.py
@@ -254,3 +254,31 @@ def SendTrainTestFunc(TrainChoice,TrainCompletion,TrainJudge,Hour,Min,StopTime,C
db.commit()
cursor.close()
return '发布成功'
+
+
+# def Find_dic(dic):
+# # 获取字典的键,并按照从大到小的顺序排序
+# keys_sorted = sorted(dic.keys(), reverse=True)
+#
+# # 取最后三个键
+# last_three_keys = keys_sorted[:3]
+#
+# # 创建一个新的字典,仅包含排序后的最后三个键及其对应的值
+# dic_last_three = {key: dic[key] for key in last_three_keys}
+#
+# return dic_last_three # 返回一个新字典,该字典仅包含排序后的最后三个键及其对应的值
+
+
+def Find_details(ID):
+ dic = {}
+ cursor = db.cursor()
+ cursor.execute(f"SELECT * FROM STUDENT_TEST WHERE STUDENT_ID=? AND TF='true' ", (ID))
+ data = cursor.fetchall()
+ for i in data:
+ dic[i[3]] = i
+ cursor.close()
+
+ # 调用Find_dic函数并传入dic字典作为参数
+ return dic
+
+# print(Find_details('20240101'))