Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup StudyScreen #28

Merged
merged 85 commits into from
Aug 13, 2020
Merged

Cleanup StudyScreen #28

merged 85 commits into from
Aug 13, 2020

Conversation

hesyifei
Copy link
Member

@hesyifei hesyifei commented Aug 6, 2020

  • Rewrite the logic in the SurveyScreen (especially in the onNextSelect function) to make it clearer.
  • Add many comments in the StudyScreen.
  • Rename states and props in StudyScreen to make it clearer.
  • Combined StudyScreen's currentQuestionId state and extraMetaData state into currentQuestionData state to make it easier for stacking future question ID and data.
  • Decompose addAnswerToAnswersListAsync in SurveyScreen to insertAnswerAsync in the answers helper file.
  • Add a isInTransition state in SurveyScreen that would make the screen blank before each question is loaded
  • Let QuestionIdSchema allow [ and ] so that the variable placeholders can be used properly.
  • Let MultipleTextQuestionSchema's indexName and variableName be question ID-compatible as they might be used in question ID.
  • Add fallbackNext to BaseQuestionSchema
    • Remove "_pna" in specialCasesStartId from ChoicesQuestionSchema.
    • Remove fallbackItemStartId from MultipleTextQuestionSchema.
  • Use an array of tuples instead of an object for specialCasesStartId in ChoicesQuestionSchema
    • This way the special case next question is deterministic in the case of ChoicesWithMultipleAnswers.

For tests:

  • Add tests for StudyScreen.
    • Tests for branching questions not added yet.
  • Fix some wrong usages of waitFor. Fix some problems with act.

Part of #11.

@hesyifei hesyifei added enhancement New feature or request testing labels Aug 6, 2020
@hesyifei hesyifei self-assigned this Aug 6, 2020
@hesyifei hesyifei marked this pull request as ready for review August 13, 2020 05:47
@hesyifei hesyifei merged commit cf2fcb0 into master Aug 13, 2020
@hesyifei hesyifei deleted the survey-screen-cleanup branch August 13, 2020 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant