You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refactor milestone answers statistics calculation
- refactor statistics calculation
- add `update_stats` function which updates milestones and milestone group statistics
- optional `incremental` argument
- if `True`, then statistics updated with any new answers since last calculation (as before)
- if `False`, then recalculates all statistics using all answers (may be needed if e.g. some junk answers are deleted by an admin)
- add apscheduler to schedule regular calls of this function (based on 271c75e)
- add `STATS_CRONTAB` to app settings to allow the schedule to be set, with a default crontab of 3am every monday
- add fastapi_injectable to allow use of fastapi dependencies outside of fastapi routes
- reduce duplication
- resolves#203
- `AnswerSession`
- add `expired` flag: initially False
- set to True by `get_or_create_current_milestone_answer_session` if it was created 7 or more days ago
- set to True when stats are updated if it was created 9 days or more ago
- includes a grace period to avoid setting a currently in use answer session to expired
- once an answer session is expired, then answers can no longer be modified / submitted by the user
- this should ensure that answers cannot be modified after they have been included in the statistics
- resolves#219
- add `included_in_statistics` flag: initially False
- set to True once the answers from this session are included in the statistics
- `MilestoneAnswer`
- remove `included_in_milestone_statistics` and `included_in_milestonegroup_statistics` flags
- this is now done at the level of an answer session rather than for each individual answer
- milestone feedback functions
- insert a `TrafficLight.invalid.value` instead of raising an exception if there are no statistics for a milestone id or group
- no longer recalculate stats when constructing feedback to avoid slowing down a user request in this case
* update openapi.json & openapi-ts client
* add some comments and small fixes
* attempt fix for flaky test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Harald Mack <harald.mack@protonmail.com>
Compute the per-milestone (detailed) feedback for all answers in a given answersession.
182
-
This is done by comparing the given answer per milestone against the mean and standard deviation of the known population of children for the child's age. If this statistics is outdated (older than a week currently) or is
183
-
missing, it is recomputed and updated in the database. See `compute_feedback_simple` for the feedback logic.
159
+
This is done by comparing the given answer per milestone against the mean and standard deviation of the known population of children for the child's age.
160
+
See `compute_feedback_simple` for the feedback logic.
184
161
Return a dictionary mapping milestonegroup -> [milestone -> feedback].
0 commit comments