Open apomalyn opened 2 months ago
Implement a BlankQuestion model extending TextQuestion.
BlankQuestion
TextQuestion
Implement a BlankViewModel that:
BlankViewModel
TextQuestionViewModel
List<String> blanksToFill
useKeyboard
void onBlankValueChange(String value, int index)
blanksToFill
isSubmitEnabled
onSubmitPressed
Implement under practices/questions/models, a BlankQuestion model extending TextQuestion:
practices/questions/models
format: QuestionFormats.blank
Implement under practices/questions, a view model BlankQuestionViewModel:
practices/questions
BlankQuestionViewModel
question.subject
_
blanksToFill[index] = value
selectedOptionsIndexes
question.allowedAnswers[0]
_onSuccess
_onFailure
Child of #192
Depends on:
Requirements
Implement a
BlankQuestion
model extendingTextQuestion
.Implement a
BlankViewModel
that:TextQuestionViewModel
List<String> blanksToFill
: list of the blanks filled by the user, only used whenuseKeyboard
is truevoid onBlankValueChange(String value, int index)
: updateblanksToFill
for a certain index.isSubmitEnabled
onSubmitPressed
: inject in the subject the answer selected by the user then validate the answer before calling the right result flow.What needs to be done
Implement under
practices/questions/models
, aBlankQuestion
model extendingTextQuestion
:format: QuestionFormats.blank
Implement under
practices/questions
, a view modelBlankQuestionViewModel
:TextQuestionViewModel
TextQuestionViewModel
needs,TextQuestion
, requires aBlankQuestion
blanksToFill
based onquestion.subject
(quantity of_
)void onBlankValueChange(String value, int index)
: it should doblanksToFill[index] = value
isSubmitEnabled
: should be true ifselectedOptionsIndexes
size equalsblanksToFill
length or allblanksToFill
values aren't empty.onSubmitPressed
:question.subject
,_
by the corresponding answer, fromselectedOptionsIndexes
orblanksToFill
based onuseKeyboard
question.allowedAnswers[0]
_onSuccess
otherwise_onFailure
Dependencies
Child of #192
Depends on:
189