Skip to content

Commit

Permalink
fix: quiz: filter problems only short answer, multiple choice and mul…
Browse files Browse the repository at this point in the history
…tiple choice image
  • Loading branch information
reorr committed Mar 26, 2024
1 parent b7fb61f commit 3782b13
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
// 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) {
Expand Down Expand Up @@ -157,8 +163,8 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
}

Future<void> submitAnswer() async {
var currentProblem = problemList[currentProblemIndex];
var answer = answerList[currentProblemIndex].answer;
final currentProblem = problemList[currentProblemIndex];
final answer = answerList[currentProblemIndex].answer;
if (answer == '') {
emit(
QuizExerciseShow(
Expand Down

0 comments on commit 3782b13

Please sign in to comment.