This commit is contained in:
NgoQuocViet2001 2026-08-09 03:28:50 +00:00 committed by GitHub
commit 0fa08aa0fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -21,7 +21,7 @@
:key="index"
v-for="(option, index) in quiz.quiz[currentQuestion]
.answerOptions"
@click="handleAnswerClick(option.isCorrect)"
@click="handleAnswerClick(option.isCorrect, quiz.quiz.length)"
class="btn ans-btn"
>
{{ option.answerText }}
@ -62,12 +62,11 @@ export default {
},
methods: {
handleAnswerClick(isCorrect) {
handleAnswerClick(isCorrect, questionCount) {
this.error = false;
let nextQuestion = this.currentQuestion + 1;
if (isCorrect) {
//always 3 questions per quiz
if (nextQuestion < 3) {
if (nextQuestion < questionCount) {
this.currentQuestion = nextQuestion;
} else {
this.complete = true;