Fix #263, #417, #430 and #457.
#263 #417: (Bulk) Regrade/recacluate resulted in wrong gradechange state (percentage) when use_latest
#430: Reopening latest session if use_latest should result in NONE, instead of the grades of that session or the grades of the second latest session.
#457: Failure to stringify graded gradeChanges with state None.
- [ ] Naming of newly introduced field
effective_timeinGradeChange - [ ] In terms of backward compatibility, is the new migration right?
- [x] More tests to cover changes
cc @inducer
Codecov Report
Merging #466 into master will increase coverage by
0.05%. The diff coverage is100%.
@@ Coverage Diff @@
## master #466 +/- ##
==========================================
+ Coverage 96.36% 96.41% +0.05%
==========================================
Files 45 45
Lines 11046 11100 +54
Branches 2055 2069 +14
==========================================
+ Hits 10644 10702 +58
+ Misses 342 340 -2
+ Partials 60 58 -2
| Impacted Files | Coverage Δ | |
|---|---|---|
| course/grades.py | 97.12% <ø> (+0.29%) |
:arrow_up: |
| course/receivers.py | 100% <100%> (ø) |
:arrow_up: |
| course/flow.py | 99.2% <100%> (+0.01%) |
:arrow_up: |
| course/models.py | 100% <100%> (+0.26%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d0c89e4...58b3421. Read the comment docs.
@inducer Can you review this? Thanks. The two TODOs need your verfication, thanks.
@inducer Can you look at this PR and make sure the migration is correct? I wish to integrate this into my instance soon, new semester is coming. Thanks!
For record:
This might result in inconsistency when grade changes are ordered improperly.
grades accumulation strategy:
use_latestA: grade time 2015 B: grade time 2016, flow completed 2014 C: grade time 2017 D: grade time 2018, flow completed 2013 Then A < B < C
But also D < B and C < D, which is a direct contradiction.
C's grade percentage should be the overall grade.
@inducer What about this? I wish to put the exempt issue later, since it's only debug-related (currently).
This is complicated (and terrifying) to review because of the long-term consequences. I just didn't have the time today. I'll try hard to get to it tomorrow night. Sorry!
NVM and Thanks alot.
Sorry for pushing you here @inducer. It seems I'll have to merge this into my instance tomorrow, if no progress is made here.
In cases when reopening a session, https://github.com/inducer/relate/blob/855801d463120e0fc74de08466e5d4ac39bac46d/course/flow.py#L510 ~~and https://github.com/inducer/relate/blob/855801d463120e0fc74de08466e5d4ac39bac46d/course/flow.py#L567~~ should also be adjusted.
Update: This seems won't be affected.
@inducer I've updated the code, looking forward to your review some day (not urging you to do it now, but hope that it will be merged someday).