Skip to content

Commit

Permalink
fix: quiz: calculate attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
reorr committed Apr 1, 2024
1 parent d0a3eb6 commit 243c358
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
}

var verdict = 'INCORRECT';
if (currentProblem.type == 'MULTIPLE_CHOICE' ||
currentProblem.type == 'MULTIPLE_CHOICE_IMAGE' &&
currentProblem.answer.correctAnswer.contains(answer)) {
if ((currentProblem.type == 'MULTIPLE_CHOICE' ||
currentProblem.type == 'MULTIPLE_CHOICE_IMAGE') &&
currentProblem.answer.correctAnswer.contains(answer)) {
verdict = 'CORRECT';
}
if (currentProblem.type == 'SHORT_ANSWER' &&
Expand All @@ -206,7 +206,7 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
.where((e) => e.verdict != null && e.verdict == 'CORRECT')
.length;
attempt.totalIncorrect = answerList
.where((e) => e.verdict == null && e.verdict == 'INCORRECT')
.where((e) => e.verdict != null && e.verdict == 'INCORRECT')
.length;

toNextQuestion();
Expand Down

0 comments on commit 243c358

Please sign in to comment.