Skip to content

Commit

Permalink
update answer input
Browse files Browse the repository at this point in the history
  • Loading branch information
DandiIndraWijaya committed Nov 10, 2023
1 parent 5aaeb2f commit ee8547a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
quizExercise: currentProblem,
remainingDuration: Duration(seconds: remainingDuration),
selectedAnswer: selectedAnswer,
shortAnswer: shortAnswer,
),
);
} else {
Expand All @@ -112,6 +113,7 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {
quizExercise: currentProblem,
remainingDuration: Duration(seconds: remainingDuration),
selectedAnswer: selectedAnswer,
shortAnswer: shortAnswer,
),
);
} catch (e) {
Expand All @@ -133,12 +135,13 @@ class QuizExerciseCubit extends Cubit<QuizExerciseState> {

void fillAnswer(String answer) {
shortAnswer = answer;

emit(
QuizExerciseShow(
quiz: quiz,
quizExercise: currentProblem,
remainingDuration: Duration(seconds: remainingDuration),
shortAnswer: answer,
shortAnswer: shortAnswer,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class QuizExerciseShow extends QuizExerciseState {
final String selectedAnswer;
final String shortAnswer;
final String modalErrorMessage;

const QuizExerciseShow({
required this.quiz,
required this.quizExercise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,8 @@ class _QuizExercisePageState extends State<QuizExercisePage> {
backgroundColor: Colors.red,
duration: const Duration(seconds: 1),
behavior: SnackBarBehavior.floating,
margin: EdgeInsets.only(
bottom:
MediaQuery.of(context).size.height - 150,
left: 10,
right: 10),
margin: const EdgeInsets.only(
bottom: 50, left: 10, right: 10),
content: Text(error),
);

Expand Down

0 comments on commit ee8547a

Please sign in to comment.