Skip to content

Commit

Permalink
fix: quiz: show finish button
Browse files Browse the repository at this point in the history
  • Loading branch information
reorr committed Apr 1, 2024
1 parent 2904dca commit d0a3eb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,21 +209,7 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
.where((e) => e.verdict == null && e.verdict == 'INCORRECT')
.length;

if (currentProblemIndex < problemIdList.length) {
currentProblemIndex++;
}

emit(
QuizExerciseShow(
quiz: quiz,
quizExercise: problemList[currentProblemIndex],
remainingDuration: Duration(seconds: remainingDuration),
attempt: attempt,
answer: answerList[currentProblemIndex],
currentProblemIndex: currentProblemIndex,
totalProblem: problemIdList.length,
),
);
toNextQuestion();
}

Future<void> finishExercise() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class TaskView extends StatelessWidget {
),
),
if (attempt.totalBlank == 0)
SizedBox(
const SizedBox(
height: 12,
),
if (attempt.totalBlank == 0)
Expand All @@ -189,7 +189,7 @@ class TaskView extends StatelessWidget {
text: 'FINISH',
buttonType: ButtonType.tertiary,
onTap: () {
context.read<QuizExerciseCubit>().toNextQuestion();
context.read<QuizExerciseCubit>().finishExercise();
},
),
),
Expand Down
2 changes: 2 additions & 0 deletions app/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import firebase_messaging
import firebase_storage
import flutter_local_notifications
import geolocator_apple
import google_sign_in_ios
import path_provider_foundation
import printing
import shared_preferences_foundation
Expand All @@ -26,6 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
Expand Down

0 comments on commit d0a3eb6

Please sign in to comment.