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.
This commit is contained in:
David Mudrák 2015-07-16 19:38:48 +02:00
parent bfde810a8b
commit 65ba4cdad2

View File

@ -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;