diff --git a/lib/component/quiz_container_component.dart b/lib/component/quiz_container_component.dart index 4e8c644..d9fd6c6 100644 --- a/lib/component/quiz_container_component.dart +++ b/lib/component/quiz_container_component.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; import 'package:quiz_app/app/const/colors/app_colors.dart'; import 'package:quiz_app/data/models/quiz/quiz_listing_model.dart'; @@ -18,6 +19,7 @@ class QuizContainerComponent extends StatelessWidget { onTap: () => onTap(data.quizId), child: Container( padding: const EdgeInsets.all(14), + margin: EdgeInsets.symmetric(vertical: 5), decoration: BoxDecoration( color: AppColors.background, borderRadius: BorderRadius.circular(12), @@ -50,7 +52,7 @@ class QuizContainerComponent extends StatelessWidget { color: const Color(0xFF0052CC), borderRadius: BorderRadius.circular(8), ), - child: const Icon(Icons.school, color: Colors.white, size: 28), + child: const Icon(LucideIcons.box, color: Colors.white, size: 28), ); } diff --git a/lib/component/widget/quiz_item_wa_component.dart b/lib/component/widget/quiz_item_wa_component.dart index ea7e79a..c650fe3 100644 --- a/lib/component/widget/quiz_item_wa_component.dart +++ b/lib/component/widget/quiz_item_wa_component.dart @@ -113,8 +113,14 @@ class QuizItemWAComponent extends StatelessWidget { Widget _buildAnswerIndicator(BuildContext context) { final icon = isCorrect ? LucideIcons.checkCircle2 : LucideIcons.xCircle; final color = isCorrect ? AppColors.primaryBlue : Colors.red; + final String userAnswerText; + + if (userAnswer == null || userAnswer == -1) { + userAnswerText = "Tidak Menjawab"; + } else { + userAnswerText = isOptionType ? options![userAnswer] : userAnswer.toString(); + } - final String userAnswerText = isOptionType ? options![userAnswer] : userAnswer.toString(); final String correctAnswerText = targetAnswer.toString(); return Column( diff --git a/lib/feature/quiz_preview/controller/quiz_preview_controller.dart b/lib/feature/quiz_preview/controller/quiz_preview_controller.dart index c6e5336..177caf6 100644 --- a/lib/feature/quiz_preview/controller/quiz_preview_controller.dart +++ b/lib/feature/quiz_preview/controller/quiz_preview_controller.dart @@ -122,7 +122,7 @@ class QuizPreviewController extends GetxController { logC.e(e); } finally { isLoading.value = false; - CustomFloatingLoading.hideLoadingDialog(Get.context!); + // CustomFloatingLoading.hideLoadingDialog(Get.context!); } } @@ -132,7 +132,7 @@ class QuizPreviewController extends GetxController { final q = entry.value; String typeString; - String answer = ""; + dynamic answer; List? option; switch (q.type) { @@ -142,12 +142,12 @@ class QuizPreviewController extends GetxController { break; case QuestionType.option: typeString = 'option'; - answer = q.correctAnswerIndex.toString(); + answer = q.correctAnswerIndex; option = q.options?.map((o) => o.text).toList(); break; case QuestionType.trueOrFalse: typeString = 'true_false'; - answer = q.answer ?? ""; + answer = q.answer!.contains("true"); break; default: typeString = 'fill_the_blank';