develop #1
|
@ -12,7 +12,7 @@ class QuizCreationController extends GetxController {
|
|||
|
||||
RxBool isGenerate = true.obs;
|
||||
Rx<QuestionType> currentQuestionType = QuestionType.fillTheBlank.obs;
|
||||
RxList<QuestionData> quizData = <QuestionData>[QuestionData(index: 1)].obs;
|
||||
RxList<QuestionData> quizData = <QuestionData>[QuestionData(index: 1, type: QuestionType.fillTheBlank)].obs;
|
||||
RxInt selectedQuizIndex = 0.obs;
|
||||
|
||||
@override
|
||||
|
@ -53,7 +53,11 @@ class QuizCreationController extends GetxController {
|
|||
// Listener perubahan tipe soal
|
||||
ever<QuestionType>(currentQuestionType, (type) {
|
||||
if (quizData.isNotEmpty) {
|
||||
_updateCurrentQuestion(type: type);
|
||||
if (type == QuestionType.option) {
|
||||
_updateCurrentQuestion(type: type, correctAnswerIndex: 0);
|
||||
} else {
|
||||
_updateCurrentQuestion(type: type, correctAnswerIndex: null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue