|
@@ -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
|