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