develop #1
|
@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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<String>? 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';
|
||||
|
|
Loading…
Reference in New Issue