diff --git a/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_cubit.dart b/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_cubit.dart index 48dd5ad..51e95ab 100644 --- a/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_cubit.dart +++ b/app/lib/features/quiz_exercise/presentation/bloc/quiz_exercise_cubit.dart @@ -70,6 +70,12 @@ class QuizExerciseCubit extends Cubit { // Fetch all quiz data problemList = await quizExerciseRepository.getListQuizExercise( taskIds: problemIdList); + problemList = problemList + .where((quizExercise) => + quizExercise.type == 'MULTIPLE_CHOICE' || + quizExercise.type == 'MULTIPLE_CHOICE_IMAGE' || + quizExercise.type == 'SHORT_ANSWER') + .toList(); // TODO(someone): fix the check logic later // if (weeklyQuizParticipant.attempts.isEmpty) { @@ -157,8 +163,8 @@ class QuizExerciseCubit extends Cubit { } Future submitAnswer() async { - var currentProblem = problemList[currentProblemIndex]; - var answer = answerList[currentProblemIndex].answer; + final currentProblem = problemList[currentProblemIndex]; + final answer = answerList[currentProblemIndex].answer; if (answer == '') { emit( QuizExerciseShow(