-
-
-
{/* 前端连接数据库⬇ */}
- { !isTrue&&TrainData&&
-
{TrainData['operateID'][3][0]}
+ { !isTrue&&TrainData&&Src&&
+
{TrainData['operateID'][3][0]}
+
{Src[6]}
+
+
{Src[7]}
+
+
{Src[8]}
点击以上链接前往实训
-
}
+
+
+ }
{/* 前端连接数据库 ⬆*/}
{/* 达梦数据库连接 ⬇*/}
{ isTrue&&TrainData&&
{TrainData['operateID'][3][0]}
-
-
-
+ {Src&&
}
+
}
{/* 达梦数据库连接⬆ */}
diff --git a/app-dm/src/setupProxy.js b/app-dm/src/setupProxy.js
index 2dedd89..9a95cdf 100644
--- a/app-dm/src/setupProxy.js
+++ b/app-dm/src/setupProxy.js
@@ -4,7 +4,7 @@ module.exports = function(app) {
app.use(
'/api', // 如果请求路径匹配'/api',则进行代理
createProxyMiddleware({
- target: 'http://36.138.114.105:32087/', // 目标后端服务地址
+ target: 'http://36.138.114.105:31055/', // 目标后端服务地址
changeOrigin: true,
})
);
diff --git a/python/app.py b/python/app.py
index a01e096..491b45a 100644
--- a/python/app.py
+++ b/python/app.py
@@ -288,7 +288,8 @@ def NotMarkTest():
def UpdateTest():
testID=request.json['testID']
score=request.json['score']
- submitScoreFunc(score,testID)
+ suggestion=request.json['suggestion']
+ submitScoreFunc(score,testID,suggestion)
print('修改成功')
return '修改成功'
@@ -316,9 +317,13 @@ def teacher_create_pod():
def teacher_delete_pod():
return delete_pod("test2")
-@app.route("/api/teacher/check_pod") # 检测数据库是否安装成功 若成功,返回OK 否则返回NO
+@app.route("/api/student/check_pod",methods=['POST']) # 检测数据库是否安装成功 若成功,返回OK 否则返回NO
def teacher_check_pod():
- return check_dm("test")
+ name=request.json["student_ID"]
+ testID=request.json["operateID"]
+ name= 'n' + str(name) + '-' + str(testID)
+ result = check_dm(name)
+ return jsonify({'result':result})
@app.route('/')
@app.route('/
')
diff --git a/python/del.py b/python/del.py
index 642c494..b21fa5e 100644
--- a/python/del.py
+++ b/python/del.py
@@ -1,5 +1,5 @@
import k8s_func
-studentList=['s20240103-44']
+studentList=['n20240101-53','s20240101-50','s20240102-50']
for i in studentList:
k8s_func.delete_pod(i)
diff --git a/python/student_func.py b/python/student_func.py
index af1d9a2..99dd3dc 100644
--- a/python/student_func.py
+++ b/python/student_func.py
@@ -334,13 +334,12 @@ def HistoryTrainFunc(ID):
def FindTrain1SrcFunc(ID,testID):
cursor=db.cursor()
- cursor.execute("SELECT LINK FROM TRAINSCORE WHERE STUDENT_ID=? AND TEST_ID=?",(ID,testID))
- result=cursor.fetchall()[0][0]
- print(result)
+ cursor.execute("SELECT * FROM TRAINSCORE WHERE STUDENT_ID=? AND TEST_ID=?",(ID,testID))
+ result=cursor.fetchall()[0]
cursor.close()
return result
-# FindTrain1SrcFunc('20240101','3')
+# FindTrain1SrcFunc('20240101','54')
diff --git a/python/teacher_func.py b/python/teacher_func.py
index 32a4e0a..a80968f 100644
--- a/python/teacher_func.py
+++ b/python/teacher_func.py
@@ -288,9 +288,9 @@ def SendLink():
item = k8s_func.list_services()
for j in item['list']:
if j['name'] == name + '-service':
- Link = 'http://36.138.114.105/' + str(j['ports'][0]['node_port'])
- Link2 = 'http://36.138.114.105/' + str(j['ports'][1]['node_port'])
- Link3 = 'http://36.138.114.105/' + str(j['ports'][2]['node_port'])
+ Link = 'http://36.138.114.105:' + str(j['ports'][0]['node_port'])
+ Link2 = 'http://36.138.114.105:' + str(j['ports'][1]['node_port'])
+ Link3 = 'http://36.138.114.105:' + str(j['ports'][2]['node_port'])
cursor.execute(f"INSERT INTO TRAINSCORE VALUES (?,?,?,?,?,?,?,?,?)",(
i,i[0:6],testID,'false','NULL','NULL',Link,Link2,Link3
))
@@ -369,10 +369,10 @@ def NotMarkTestFunc(testID):
return dic
# NotMarkTest('9')
-def submitScoreFunc(score,testID):
+def submitScoreFunc(score,testID,suggestion):
cursor = db.cursor()
for i in score:
- cursor.execute(f'UPDATE TRAINSCORE SET TRAINRESULT=? WHERE TEST_ID=? AND STUDENT_ID=?', (score[i], testID,i))
+ cursor.execute(f'UPDATE TRAINSCORE SET TRAINRESULT=? ,CRECOMMENDATION=?WHERE TEST_ID=? AND STUDENT_ID=?', (score[i],suggestion[i], testID,i))
cursor.execute(f'UPDATE TEACHERMARK SET TF=? WHERE TRAINID=?',('true',testID))
db.commit()