There is a persistent oddity with mdl_assign_submission. On executing the query, the submitted dates that are returned are not correct. I check a few samples of those dates against FN_marking_manager's submitted dates, and there is no correlation whatsover. Very confusing...
The query:
SELECT DISTINCT gg.id AS 'ID' , u.firstname AS 'Name' , u.lastname AS 'Surname' ,
(CASE
WHEN cc.parent = '2' THEN 'Fundamentals'
WHEN cc.parent = '3' THEN 'Core'
WHEN cc.parent = '4' THEN 'Elective'
END) AS 'Category',
cc.name AS 'Module',
c.shortname AS 'Course',
IF (gi.itemname LIKE '%formative%', ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2),'') AS 'Formative',
IF (gi.itemname LIKE '%summative%', ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2),'') AS 'Summative',
DATE_FORMAT(FROM_UNIXTIME(sub.timemodified), '%d/%m/%y') AS 'Modified'
from_unixtime(gg.timemodified, '%d/%m/%y') AS 'Date',
IF (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) >= 60,'Yes' , 'NYC') AS Competent
FROM mdl_course AS c
JOIN mdl_context AS ctx ON c.id = ctx.instanceid
JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id
JOIN mdl_user AS u ON u.id = ra.userid
JOIN mdl_assign_submission AS sub ON u.id = sub.userid
JOIN mdl_grade_grades AS gg ON gg.userid = u.id
JOIN mdl_grade_items AS gi ON gi.id = gg.itemid
JOIN mdl_grade_items_history AS gih ON gi.id = gg.itemid
JOIN mdl_course_categories AS cc ON cc.id = c.category
WHERE gi.courseid = c.id
AND gi.itemname != 'Attendance'
AND u.firstname LIKE '%" . $thisgroup . "%'
AND gi.itemname LIKE '%mative%'
Getting the marked date is easy enough, but I have been struggling to get the submitted date.
BTW mdl_assignment_submissions is empty and holds no data on our system (odd...)
Any pointers here would be really welcomed.
by Leon Franken.