MOODLE Report:

Assignments submitted That "Needs Grading"

Problem

Moodle out of the box doesn't provide a global report that will show all Assignments that are submitted but needs grading. The following SQL query can be used together with Moodle module called Ad-hoc report or Configurable reports.

Resolution

Assuming you have already the Ad-hoc Report or Configurable Reports installed within your Moodle environment. After that is as simple as copy and paste the following SQL query.

SELECT
prefix_user.username AS "Student ID",
prefix_user.firstname AS "First name",
prefix_user.lastname AS "Last name",
prefix_course.fullname AS "Unit name",
prefix_assign.name AS "Assignment name", concat("<a target='_new' href='%%WWWROOT%%/mod/assign/view.php%%Q%%id=",prefix_course_modules.id,"&rownum=0&action=grader&userid=",prefix_user.id,"'>Grade</a>") AS "Assignment link"

FROM (((prefix_assign_grades
INNER JOIN prefix_assign ON prefix_assign_grades.assignment = prefix_assign.id)
INNER JOIN prefix_course ON prefix_assign.course = prefix_course.id)
INNER JOIN prefix_user ON prefix_assign_grades.userid = prefix_user.id)
INNER JOIN prefix_course_modules ON (prefix_course_modules.instance = prefix_assign.id) AND (prefix_course.id = prefix_course_modules.course)

WHERE (((prefix_assign_grades.grade)=-1) AND ((prefix_course_modules.module)="1"))

ORDER BY prefix_user.username, prefix_course.id

Save and enjoy.

Report - Assignment Needs Grading