diff --git a/Untitled-5.html b/Untitled-5.html index 7828056..f9ba349 100644 --- a/Untitled-5.html +++ b/Untitled-5.html @@ -1,15 +1,3 @@ - {setChange(false)}} - onOk={e=>{setChange(false)}} - footer={
- - -
} - > - -
\ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 0cc2796..14e3fd4 100644 --- a/src/pages.json +++ b/src/pages.json @@ -129,6 +129,11 @@ "style": { "navigationBarTitleText": "shnagke" } + },{ + "path": "pages/quiz_outclass/quiz_outclass", + "style": { + "navigationBarTitleText": "课程答题" + } } ], "tabBar": { diff --git a/src/pages/learning/learning.vue b/src/pages/learning/learning.vue index 342af93..79a20ea 100644 --- a/src/pages/learning/learning.vue +++ b/src/pages/learning/learning.vue @@ -66,7 +66,7 @@ { name: '答题', icon: '/static/student-course/quiz.png', - page: '/pages/quiz/quiz' + page: '/pages/quiz_outclass/quiz_outclass?uuid=b2d2ece7-2994-4580-b45d-b2288ecd80de' }, { name: '考试', diff --git a/src/pages/quiz/quiz.vue b/src/pages/quiz/quiz.vue index 8e5f2d5..9ff2822 100644 --- a/src/pages/quiz/quiz.vue +++ b/src/pages/quiz/quiz.vue @@ -140,6 +140,7 @@ const dx=ref('0'); const moredx=ref([]) const pdt=ref("none") const tkt=ref([]) +const uid=ref('122') const dati_able=ref(true) const intervalId = ref(null); // 修改了此处的类型定义 const endtime=ref('') @@ -188,7 +189,7 @@ function tkt_one_get(xx:string,index:number){ onLoad((options) => { console.log('load', options) if(options) { - + uid.value=options.uuid; console.log('options:', options.uuid) uni.request({ url: 'http://localhost:3400/apistu/getinclassactive', @@ -206,6 +207,25 @@ onLoad((options) => { } }); } + uni.request({ + url: 'http://localhost:3400/apistu/getinclassactivestu_ex', + method: 'GET', + data: { // 注意:GET 请求的参数需放在 `data` 而非 `params` 字段:ml-citation{ref="8" data="citationList"} + uuid: options.uuid, + xuehao:'202413501062' + }, + success: (res) => { /* ... */ + console.log(res.data) + if(res.data.length>0) { + stopTimer(); + dati_able.value=false + tijiao_type.value="已提交" + console.log(res.data) + + + } + } + }); if(question.value.tx==="填空题") { tkt.value = new Array(question.value.tk.length).fill(''); } @@ -221,7 +241,8 @@ function moredx_one(xx:string){ } const startTimer = () => { intervalId.value = setInterval(() => { - if (totaltime.value >0) { + + if (totaltime.value >0&&tijiao_type.value!=="已提交") { totaltime.value=moment(endtime.value).diff(moment(),'seconds') @@ -349,7 +370,7 @@ function submitAnswers() { zq=false; } }) - if(question.value.morechoose.length===moredx.value.length){ + if(question.value.morechoose.length!==moredx.value.length){ zq=false; } let dxt={stu:moredx.value,all:question.value.morechoose} @@ -389,7 +410,8 @@ function submitAnswers() { if(pd_work!==question.value.onechoose)zq=false; - let dxt={stu:dx.value,all:question.value.onechoose} + let dxt={stu:pd_work,all:question.value.onechoose} + if(zq){ resulttm.stu=question.value.print resulttm.all=question.value.print @@ -402,7 +424,7 @@ function submitAnswers() { console.log(resulttm) } uni.request({ - url: 'http://localhost:3400/apistu/addinactivestu_qiangda', + url: 'http://localhost:3400/apistu/inclassdati_tijiao', method: 'POST', data: { // 注意:GET 请求的参数需放在 `data` 而非 `params` 字段:ml-citation{ref="8" data="citationList"} uuid: uid.value, @@ -410,11 +432,12 @@ function submitAnswers() { kctime:'n8z1A1', xuehao: '202413501063', time:moment().format('YYYY-MM-DD HH:mm:ss'), - starttime:starttime.value, - name:"刘东阳A", - touxiangcolor:"red" + name:"刘东阳", + touxiangcolor:"red", + tmresult:resulttm }, success: (res) => { /* ... */ + uni.$emit('finish_ex',{uuid:uid.value,wb:'已完成'}) console.log(res.data) } diff --git a/src/pages/quiz_outclass/quiz_outclass.vue b/src/pages/quiz_outclass/quiz_outclass.vue new file mode 100644 index 0000000..9d5f155 --- /dev/null +++ b/src/pages/quiz_outclass/quiz_outclass.vue @@ -0,0 +1,311 @@ + + + + +