-
Bug
-
Resolution: Fixed
-
Critical
-
2.5
-
MOODLE_25_STABLE
-
MOODLE_25_STABLE
-
MDL-41092-master -
When the cron function under assingments is run , the SQL used to get the submissions for each course is incorrect. The SQL starts by selecting the course column from the assign table which is a foreign key ( to course table). Hence , the get_records_sql() method outputs this error whenever it finds more than one course linked to an assignment ( which is a perfectly normal case ):
Error |
Did you remember to make the first column something unique in your call to get_records? Duplicate value 'xxxxxx' found in column 'course'.* line 1014 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
|
* line 1493 of /mod/assign/locallib.php: call to mysqli_native_moodle_database->get_records_sql()
|
* line 859 of /mod/assign/lib.php: call to assign::cron()
|
* line 267 of /lib/cronlib.php: call to assign_cron()
|
* line 61 of /admin/cli/cron.php: call to cron_run()
|
Code in Moodle 2.5 looks like this :
/mod/assign/locallib.php |
$sql = 'SELECT a.course, a.name, a.blindmarking, a.revealidentities,
|
g.*, g.id as gradeid, g.timemodified as lastmodified
|
FROM {assign} a
|
JOIN {assign_grades} g ON g.assignment = a.id
|
LEFT JOIN {assign_user_flags} uf ON uf.assignment = a.id AND uf.userid = g.userid
|
WHERE g.timemodified >= :yesterday AND
|
g.timemodified <= :today AND
|
uf.mailed = 0';
|
In my understanding,SQL used in Moodle 2.2.6 took care of that by calling on the submissions table first like this:
/mod/assignment/lib.php |
function assignment_get_unmailed_submissions($starttime, $endtime) {
|
global $CFG, $DB;
|
|
return $DB->get_records_sql("SELECT s.*, a.course, a.name
|
FROM {assignment_submissions} s,
|
{assignment} a
|
WHERE s.mailed = 0
|
AND s.timemarked <= ?
|
AND s.timemarked >= ?
|
AND s.assignment = a.id", array($endtime, $starttime));
|
}
|
- blocks
-
MDLQA-5789 CLONE - Students receive notification when their assignment submission is graded
-
- Passed
-
- is a regression caused by
-
MDL-36804 New Feature Request: Assignment Resubmission System - We need a clear and user-friendly of method of handling resubmitted assignments.
-
- Closed
-