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

a MilestoneAnswerSession should have a fixed set of milestone groups and milestones #189

Closed
lkeegan opened this issue Nov 26, 2024 · 0 comments · Fixed by #191
Closed

a MilestoneAnswerSession should have a fixed set of milestone groups and milestones #189

lkeegan opened this issue Nov 26, 2024 · 0 comments · Fixed by #191
Labels

Comments

@lkeegan
Copy link
Member

lkeegan commented Nov 26, 2024

Currently we construct the appropriate milestone groups and milestones for a child on the fly based on their age, in get_milestone_groups

We then only create a MilestoneAnswer, and if needed a new MilestoneAnswerSession, when an answer is submitted.

This is robust to changes in which milestones are included by get_milestone_groups, but it is not ideal for calculating the traffic light feedback, in particular the age-appropiate milestones may have changed, and we also need to know if there were milestones that were not answered.

For calculating the feedback, it would be better if all the MilestoneAnswers were created when a MilestoneAnswerSession is created, and for the milestone group to be easily determined from a MilestoneAnswer.

Todo:

  • get_milestone_groups
    • should call get_or_create_current_milestone_answer_session
  • get_or_create_current_milestone_answer_session
    • should create a MilestoneAnswer for each milestone in the session
    • with none or equivalent as the answer
  • get_current_milestone_answer_session
    • maybe combine with get milestone groups?
    • it could return e.g. {milestones: ..., answers: ...}, now that both are created together
  • MilestoneAnswer
    • should have a milestone_group_id field for convenience when calculating feedback / stats
    • needs a none value for the answer (this could be e.g. -1)
  • frontend milestone component
    • update logic accordingly
@lkeegan lkeegan added enhancement New feature or request frontend backend labels Nov 26, 2024
@lkeegan lkeegan added this to the Minimal Viable Product milestone Nov 26, 2024
lkeegan added a commit that referenced this issue Nov 27, 2024
- MilestoneAnswer
  - An answer is now created for every milestone when an answer session is created
  - The initial value of the answer is `-1` which indicates the user has not yet submitted an answer for this milestone
  - Add `milestone_group_id` field for convenience when calculating statistics / feedback
- get_milestone_groups
  - Now returns the milestones according to the MilestoneAnswers for the current session
  - This means the set of milestones is fixed and doesn't change even if a milestone expected_age changes such that it would no longer be selected for that session
- update_milestone_answer
  - no longer creates an answer session if there is no existing unexpired one
  - either updates the existing answer for the supplied session, or returns 404 or 401
- Milestone component
  - all answers now exist, replace check for existence with check for `-1` to determine if the answer has already been answered
- add types-python-dateutil to mypy pre-commit hook dependencies
  - remove out-dated comment & type ignores from related code
- resolves #189
MaHaWo pushed a commit that referenced this issue Nov 27, 2024
…191)

- MilestoneAnswer
  - An answer is now created for every milestone when an answer session is created
  - The initial value of the answer is `-1` which indicates the user has not yet submitted an answer for this milestone
  - Add `milestone_group_id` field for convenience when calculating statistics / feedback
- get_milestone_groups
  - Now returns the milestones according to the MilestoneAnswers for the current session
  - This means the set of milestones is fixed and doesn't change even if a milestone expected_age changes such that it would no longer be selected for that session
- update_milestone_answer
  - no longer creates an answer session if there is no existing unexpired one
  - either updates the existing answer for the supplied session, or returns 404 or 401
- Milestone component
  - all answers now exist, replace check for existence with check for `-1` to determine if the answer has already been answered
- add types-python-dateutil to mypy pre-commit hook dependencies
  - remove out-dated comment & type ignores from related code
- resolves #189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant