浏览代码

fixed #327

ali 2 年之前
父节点
当前提交
e85979b69b
共有 1 个文件被更改,包括 9 次插入 和 1 次删除
  1. 9 1
      src/components/Widgets/Test/TestParticipation/TestParticipation.vue

+ 9 - 1
src/components/Widgets/Test/TestParticipation/TestParticipation.vue

@@ -205,10 +205,18 @@ export default {
       // Calculate the remaining time in seconds considering the duration
       return Math.floor((durationInMinutes * 60) - timeDiffInSeconds)
     },
+    onTimeout () {
+      this.$q.notify({
+        type: 'negative',
+        message: 'زمان آزمون به اتمام رسیده است.'
+      })
+      this.stopTimer()
+      this.backToClassList()
+    },
     startTimer () {
       this.timerInterval = setInterval(() => {
         if (this.remainingTime <= 0) {
-          this.stopTimer()
+          this.onTimeout()
         } else {
           this.remainingTime--
           this.answerBook.remainingTime = this.remainingTime