Closed agwells closed 9 years ago
Cant check now, but might be intended behaviour. What if teacher selected 'no grade' (just opened assignment and clicked submit without changing anything)? Anyway, push the fix, I will check later if it works in all cases.
On Monday, 9 November 2015, Aaron Wells notifications@github.com wrote:
Closed #17 https://github.com/MaharaProject/moodle-assignsubmission_mahara/issues/17 via 1997cdc https://github.com/MaharaProject/moodle-assignsubmission_mahara/commit/1997cdc00230d3a1648d83027c67f895c4729f4c .
— Reply to this email directly or view it on GitHub https://github.com/MaharaProject/moodle-assignsubmission_mahara/issues/17#event-458430703 .
If you're using a scale and you do "no grade", it gives $grade->grade == -1. If you're using numeric grading and you leave the grade field empty, it does $grade->grade == null.
I noticed this problem because my default test case is a jerky teacher who gives the student a 0 and writes mean feedback comments. ;)
To replicate:
Expected result: The Mahara page should unlock (because it is now graded) Actual result: The Mahara page remains locked
This is caused because the unlocking code checks for empty($grade->grade) to see whether the teacher graded the assignment, or submitted it with no grade. The PHP "empty()" method returns true on null, empty string, undefined variable, OR the numeral "0".