ali 2 лет назад
Родитель
Сommit
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
       // Calculate the remaining time in seconds considering the duration
       return Math.floor((durationInMinutes * 60) - timeDiffInSeconds)
       return Math.floor((durationInMinutes * 60) - timeDiffInSeconds)
     },
     },
+    onTimeout () {
+      this.$q.notify({
+        type: 'negative',
+        message: 'زمان آزمون به اتمام رسیده است.'
+      })
+      this.stopTimer()
+      this.backToClassList()
+    },
     startTimer () {
     startTimer () {
       this.timerInterval = setInterval(() => {
       this.timerInterval = setInterval(() => {
         if (this.remainingTime <= 0) {
         if (this.remainingTime <= 0) {
-          this.stopTimer()
+          this.onTimeout()
         } else {
         } else {
           this.remainingTime--
           this.remainingTime--
           this.answerBook.remainingTime = this.remainingTime
           this.answerBook.remainingTime = this.remainingTime