Commit 590c834
committed
Fix all working time queries according to latest research results
There were multiple problems with multiple working time queries.
1. In general, the queries assumed that the ID of submissions were sorted by created_at, which isn't the case in production data. Therefore, we sort by created_at rather than ID.
2. The query used to get quantiles (in `get_quantiles`) missed the `contributor_type`, which caused problems after adding Programming Groups in 319c3ab. (It seems like we missed to add it there).
3. The query used for the study group dashboard (in `study_group_working_time_query`) potentially returned wrong data when learners reached the same score twice. Also, the last time difference required to achieve the maximum score could have been missing from the total. Both errors were fixed. Further, we added the exercise_id, potentially allowing this query to be used for more broad scenarios.
These fixes are intended as a first, intermediate improvement. We should still reduce the number of different queries and ideally use only one common one. It seems like there are multiple repetitions of similar code present.
While working on these fixes and testing them, I noticed that the study group dashboard is broken for exercises with many diverse, close scores since buckets can be overwritten. This should be fixed in a follow-up task. Then, the working time calculation might also be extended by considering interventions (which are currently lacking and cause differences to the external user statistics, where they are considered).1 parent 914a5fd commit 590c834
1 file changed
+182
-100
lines changed
0 commit comments