Merge branch 'master' of https://gitea.xn--7p0a.site/2312072104/dm
This commit is contained in:
commit
2c486a8c0a
|
@ -11,7 +11,7 @@ import axios from 'axios';
|
|||
|
||||
function Operation1() {
|
||||
const click=()=>{
|
||||
console.log(answeredJudge);
|
||||
console.log(TrainData);
|
||||
}
|
||||
const clear=()=>{
|
||||
localStorage.removeItem('choice_answers');
|
||||
|
@ -26,6 +26,7 @@ function Operation1() {
|
|||
setAnsweredComple([])
|
||||
localStorage.removeItem('answeredJudge')
|
||||
setAnsweredJudge([])
|
||||
localStorage.removeItem('RemainingTime')
|
||||
}
|
||||
|
||||
const { operateID } = useParams();
|
||||
|
@ -39,13 +40,19 @@ function Operation1() {
|
|||
})
|
||||
const returnData=TrainDataSrc.data
|
||||
setTrainData(returnData)
|
||||
setCountdown(60*parseInt(returnData['operateID'][4]))
|
||||
//60*parseInt(returnData['operateID'][4]
|
||||
}catch{
|
||||
alert('TrainDataFunc出错')
|
||||
}
|
||||
}
|
||||
useEffect(()=>{
|
||||
TrainDataFunc()
|
||||
const RemainingTime=localStorage.getItem('RemainingTime')
|
||||
if(!isNaN(RemainingTime) && RemainingTime !== '') {
|
||||
setCountdown(RemainingTime);
|
||||
} else {
|
||||
setCountdown(60 * parseInt(TrainData['operateID'][4]));
|
||||
}
|
||||
},[])
|
||||
//倒计时
|
||||
const [countdown, setCountdown] = useState();
|
||||
|
@ -58,6 +65,7 @@ function Operation1() {
|
|||
let interval = setInterval(() => {
|
||||
if (countdown != 0) {
|
||||
setCountdown(countdown - 1);
|
||||
localStorage.setItem('RemainingTime',countdown)
|
||||
} else {
|
||||
clearInterval(interval);
|
||||
alert('考试时间到!');
|
||||
|
@ -130,6 +138,7 @@ function Operation1() {
|
|||
localStorage.setItem('answeredChoice',answeredChoice)
|
||||
localStorage.setItem('answeredComple',answeredComple)
|
||||
localStorage.setItem('answeredJudge',answeredJudge)
|
||||
|
||||
};
|
||||
|
||||
// 在组件加载时从 localStorage 中恢复答案
|
||||
|
|
|
@ -11,6 +11,10 @@ import top from '../img/top.jpg'
|
|||
|
||||
function Operation2() {
|
||||
const { operateID } = useParams();
|
||||
//获取剩余时间
|
||||
const RemainingTime=localStorage.getItem('RemainingTime')
|
||||
|
||||
|
||||
//终端
|
||||
const terminalObj = useRef(null);
|
||||
let sock = null;
|
||||
|
@ -63,15 +67,15 @@ function Operation2() {
|
|||
|
||||
// 倒计时初始化
|
||||
useEffect(() => {
|
||||
const examDuration = 60 * 60; // 假设考试时长为1小时
|
||||
setCountdown(examDuration);
|
||||
setCountdown(RemainingTime);
|
||||
}, []);
|
||||
|
||||
// 倒计时更新
|
||||
useEffect(() => {
|
||||
let interval = setInterval(() => {
|
||||
if (countdown > 0) {
|
||||
if (countdown != 0) {
|
||||
setCountdown(countdown - 1);
|
||||
localStorage.setItem('RemainingTime',countdown)
|
||||
} else {
|
||||
clearInterval(interval);
|
||||
alert('考试时间到!');
|
||||
|
|
|
@ -23,8 +23,8 @@ import ClassID from '../TeacherPages/classlistpages/classId';
|
|||
import ManageTest from '../TeacherPages/TestManage/ManageTest';
|
||||
import SendTest from '../TeacherPages/TestManage/SendTest';
|
||||
import Marking from '../TeacherPages/MarkingPages/Marking';
|
||||
import SendTrain from '../TeacherPages/TrainManage/SendTrain';
|
||||
import TrainManage from '../TeacherPages/TrainManage/Trainmanage';
|
||||
import SendTrain from '../TeacherPages//Trainmanage/SendTrain';
|
||||
import TrainManage from '../TeacherPages/Trainmanage/Trainmanage';
|
||||
import StudentLink from '../TeacherPages/MarkingPages/StudentLink';
|
||||
import List_pods from '../TeacherPages/list_pods/list_pods';
|
||||
|
||||
|
|
|
@ -97,7 +97,6 @@ def fetch_result_func(id): # 查询一个同学在不同时间段的不同考
|
|||
for i in result:
|
||||
result_dic[i[3]]=i[5]
|
||||
cursor.close()
|
||||
print(result_dic)
|
||||
return result_dic
|
||||
|
||||
def get_lesson_func(id):
|
||||
|
|
Loading…
Reference in New Issue