The count_submissions() method does not take the actual enrolment into
account. It is part of the API that looks on all existing data
regardless the actual status of their owner. The author of the
submission may be unenrolled or suspended, in which case they are not
displayed in the report and we would get wrong figures.
$data = $workshop->prepare_grading_report_data($USER->id, $groupid, $page, $perpage, $sortby, $sorthow);
if ($data) {
$countparticipants = $workshop->count_participants();
- $countsubmissions = $workshop->count_submissions('all', $groupid);
+ $countsubmissions = $workshop->count_submissions(array_keys($data->grades), $groupid);
$a = new stdClass();
$a->submitted = $countsubmissions;
$a->notsubmitted = $data->totalcount - $countsubmissions;