-
Bug
-
Resolution: Fixed
-
Critical
-
2.9.3, 3.0, 3.1
-
MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
wip-
MDL-52397-master -
-
3.1 Sprint 5
-
Medium
To reproduce:
- As a teacher create an assign
- As a teacher set "Default setting for Notify Students" to yes
- As a teacher set "Feedback types" to "Feedback comments"
- As a student submit to the assign
- As a teacher click on the grade icon (don't use the quick grading option)
- As a teacher do not modify the grade, just add a feedback comment
- As a teacher click "Save changes"
- As an admin run the assign cron (task) (remember to use the apache user if necessary)
php schedule_task.php --execute="\\core\\task\\legacy_plugin_cron_task"
The student receives a notification telling him/her that the teacher has written feedback. That's right.
- Wait for two days and modify the comment from the same page (not the quickgrading one)
The student doesn't receive the notification.
Of course you can emulate this behaviour. Before modifying the feedback execute this query (mysql):
SELECT max(id) from mdl_assign_grades INTO @agid;
|
UPDATE mdl_assign_grades SET timemodified = (unix_timestamp()-3600*24*5) WHERE id = @agid;
|
Now add a feedback comment from the grading page (not the quickgrading one) and the student doesn't receive the notification.
If you add a comment from the quickgrading table, the message is sent always. I think that this is the expected behaviour.
I think that this is happening since the following commit was introduce:
commit 5a92a95e9c99382e0dfea92b1b03fe600aacfbab
|
Author: Damyon Wiese <damyon@moodle.com>
|
Date: Fri Oct 9 15:08:06 2015 +0800
|
|
MDL-48861 mod_assign: use >= for requires grading filter
|
|
If the grade and submission were modified at exactly the same time,
|
assume that this means the grade was automatically created for the submission
|
and is not a real grade from a teacher interaction.
|
|
diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php
|
index effc0bf..6a9d791 100644
|
--- a/mod/assign/locallib.php
|
+++ b/mod/assign/locallib.php
|
@@ -1518,7 +1518,7 @@ class assign {
|
s.assignment = :assignid AND
|
|
diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php
|
index 6a9d791..0d1c3b6 100644
|
--- a/mod/assign/locallib.php
|
+++ b/mod/assign/locallib.php
|
@@ -6678,6 +6678,7 @@ class assign {
|
global $USER, $CFG, $DB;
|
|
$grade = $this->get_user_grade($userid, true, $attemptnumber);
|
+ $originalgrade = $grade->grade;
|
$gradingdisabled = $this->grading_disabled($userid);
|
$gradinginstance = $this->get_grading_instance($userid, $grade, $gradingdisabled);
|
if (!$gradingdisabled) {
|
@@ -6722,7 +6723,12 @@ class assign {
|
}
|
}
|
}
|
- $this->update_grade($grade, !empty($formdata->addattempt));
|
+ // We do not want to update the timemodified if no grade was added.
|
+ if (!empty($formdata->addattempt) ||
|
+ ($originalgrade !== null && $originalgrade != -1) ||
|
+ ($grade->grade !== null && $grade->grade != -1)) {
|
+ $this->update_grade($grade, !empty($formdata->addattempt));
|
+ }
|
// Note the default if not provided for this option is true (e.g. webservices).
|
// This is for backwards compatibility.
|
if (!isset($formdata->sendstudentnotifications) || $formdata->sendstudentnotifications) {
|
The timemodified in grade is not changed if no grade is given and if the timemodified doesn't changes the mail (see the cron function) is not sent after a day or so.
- caused a regression
-
MDL-53601 Group feedback files only apply to graded user
-
- Closed
-
- is a regression caused by
-
MDL-48861 Assignments - Filters not working properly within grading overview
-
- Closed
-
- is duplicated by
-
MDL-42987 When the feedback on an assignment is changed an email isn't sent to the student
-
- Closed
-
- will help resolve
-
MDL-52881 Feedback Comments Not in User Report Unless Assignment is Graded
-
- Closed
-