From 65ba4cdad27610ef033fe282c6405d0c03ba119f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 16 Jul 2015 19:38:48 +0200 Subject: [PATCH] MDL-50673 workshop: Fix the way how submissions are counted 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. --- mod/workshop/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/workshop/view.php b/mod/workshop/view.php index f686bdf4641..b5e4211a6a4 100644 --- a/mod/workshop/view.php +++ b/mod/workshop/view.php @@ -230,7 +230,7 @@ case workshop::PHASE_SUBMISSION: $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;