-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
2.9.8, 3.1.3
-
None
-
Latest
-
MOODLE_29_STABLE, MOODLE_31_STABLE
In the main overview display page for a Moodle workshop, in the Submission phase column, the number of submissions expected does not respect groupings. For example, in a course with 3 groups, each with 20 students, the instructor of Group A sees that 60 submissions are expected, even though that instructor only has 20 students.
Submission phase
Provide instructions for assessment
Set up scheduled allocation
Allocate submissions
expected: 60 <-- This should be 20 as the instructor only has 20 students in his group
submitted: 1 <--This should only be the submissions for the relevant group
to allocate: 1
If I'm understanding the code correctly, the exact code is found in Lines 3111 and 3112 in /mod/workshop/locallib.php:
$numofauthors = $workshop->count_potential_authors(false);
$numofsubmissions = $DB->count_records('workshop_submissions', array('workshopid'=>$workshop->id, 'example'=>0));
The count_potential_authors function specifies $groupid = 0 so it counts all the groups (starting on line 573).
public function count_potential_authors($musthavesubmission=true, $groupid=0) {
global $DB;
list($sql, $params) = $this->get_users_with_capability_sql('mod/workshop:submit', $musthavesubmission, $groupid);
if (empty($sql))
$sql = "SELECT COUNT
FROM ($sql) tmp";
return $DB->count_records_sql($sql, $params);
}
GITHUB LINK: https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/mod/workshop/locallib.php
The code counts the total number of submissions and authors, ignoring the fact that the module is set to Separate Groups.