Skip to content

Commit

Permalink
fix: quiz: show save answer for short andwer type
Browse files Browse the repository at this point in the history
  • Loading branch information
reorr committed Mar 26, 2024
1 parent 3782b13 commit 39e7068
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
quizExercise.type == 'SHORT_ANSWER')
.toList();

problemIdList = problemList
.map((quizExercise) => quizExercise.id) // Extracting ids
.toList();

// TODO(someone): fix the check logic later
// if (weeklyQuizParticipant.attempts.isEmpty) {
answerList = problemList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TaskDialog extends StatelessWidget {
// ),
// ),
// if (!preview)
...task.question.options!.asMap().entries.map((e) {
...task.question.options.asMap().entries.map((e) {
final current = String.fromCharCode(65 + e.key);

return RadioListTile(
Expand Down Expand Up @@ -85,9 +85,14 @@ class TaskDialog extends StatelessWidget {
task.type == 'SHORT_ANSWER'
? Container(
padding: const EdgeInsets.only(top: 20),
child: CustomTextField('Jawaban anda', (value) {
context.read<QuizExerciseCubit>().fillAnswer(value);
}, (p0) => null, ''),
child: CustomTextField(
'Jawaban anda',
(value) {
context.read<QuizExerciseCubit>().fillAnswer(value);
},
(p0) => null,
answer,
),
)
: Container(),
if (!preview)
Expand Down

0 comments on commit 39e7068

Please sign in to comment.