Hi, I've been trying to get the following report: https://docs.moodle.org/310/en/ad-hoc_contributed_reports#All_Ungraded_Assignments_w.2F_Link to work on our 3.8 Moodle, but althoug no errors are produced, no results are output via the report. I'm assuming it's the query in the top-half of the sql script that's most recent, as that in the bottom half (I'm assuming this is the deprecated Assignment2 version) produces errors.
SELECT
u.firstname AS "First", u.lastname AS "Last", c.fullname AS "Course", a.name AS "Assignment", concat('<a target="_new" href="%%WWWROOT%%/mod/assign/view.php?id=', cm.id, '&rownum=0&action=grader&userid=', u.id, '">Grade</a>') AS "Assignment link" FROM prefix_assign_submission sub JOIN prefix_assign a ON a.id = sub.assignment JOIN prefix_user u ON u.id = sub.userid JOIN prefix_course c ON c.id = a.course AND c.id = %%COURSEID%% JOIN prefix_course_modules cm ON c.id = cm.course JOIN prefix_context cxt ON c.id=cxt.instanceid AND cxt.contextlevel=50 JOIN prefix_role_assignments ra ON cxt.id = ra.contextid AND ra.roleid=5 AND ra.userid=u.id WHERE cm.instance = a.id AND cm.module = 22 AND sub.status='submitted' ORDER BY c.fullname, a.name, u.lastname