MaharaProject / moodle-assignsubmission_mahara

Old, unmaintained Mahara assignment submission plugin for Moodle
https://moodle.org/plugins/view/assignsubmission_mahara
4 stars 10 forks source link

Event handler doesn't unlock the assignment if it's graded 0 #17

Closed agwells closed 9 years ago

agwells commented 9 years ago

To replicate:

  1. Create a Moodle assignment with the Mahara submission plugin, setting the locking settings to unlock after grading.
  2. Student submits a Mahara page to Mahara assignment in Moodle
  3. Teacher grades assignment with a "0"

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".

kabalin commented 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 .

agwells commented 9 years ago

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. ;)