MDL-50724 mod_assign: show issues with groups in grading table
Where a user is in multiple or no groups show and group membership is required show an appropriate error in the gradding table rather than 'Default Group'
This commit is contained in:
@@ -637,6 +637,13 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
$this->get_group_and_submission($row->id, $group, $submission, -1);
|
||||
if ($group) {
|
||||
return $group->name;
|
||||
} else if ($this->assignment->get_instance()->preventsubmissionnotingroup) {
|
||||
$usergroups = $this->assignment->get_all_groups($row->id);
|
||||
if (count($usergroups) > 1) {
|
||||
return get_string('multipleteamsgrader', 'assign');
|
||||
} else {
|
||||
return get_string('noteamgrader', 'assign');
|
||||
}
|
||||
}
|
||||
return get_string('defaultteam', 'assign');
|
||||
}
|
||||
|
||||
@@ -278,7 +278,8 @@ When reviewing assignments, teachers can leave feedback comments and upload file
|
||||
$string['modulename_link'] = 'mod/assignment/view';
|
||||
$string['modulenameplural'] = 'Assignments';
|
||||
$string['moreusers'] = '{$a} more...';
|
||||
$string['multipleteams'] = 'You\'re a member of multiple groups, please contact your teacher.';
|
||||
$string['multipleteams'] = 'Member of more than one group';
|
||||
$string['multipleteamsgrader'] = 'Member of more than one group, so unable to make submissions.';
|
||||
$string['mysubmission'] = 'My submission: ';
|
||||
$string['newsubmissions'] = 'Assignments submitted';
|
||||
$string['noattempt'] = 'No attempt';
|
||||
@@ -290,7 +291,8 @@ $string['noonlinesubmissions'] = 'This assignment does not require you to submit
|
||||
$string['nosavebutnext'] = 'Next';
|
||||
$string['nosubmission'] = 'Nothing has been submitted for this assignment';
|
||||
$string['nosubmissionsacceptedafter'] = 'No submissions accepted after ';
|
||||
$string['noteam'] = 'You\'re not a member of any group, please contact your teacher.';
|
||||
$string['noteam'] = 'Not a member of any group';
|
||||
$string['noteamgrader'] = 'Not a member of any group, so unable to make submissions.';
|
||||
$string['notgraded'] = 'Not graded';
|
||||
$string['notgradedyet'] = 'Not graded yet';
|
||||
$string['notsubmittedyet'] = 'Not submitted yet';
|
||||
@@ -435,7 +437,7 @@ $string['teamsubmissiongroupingid_help'] = 'This is the grouping that the assign
|
||||
$string['textinstructions'] = 'Assignment instructions';
|
||||
$string['timemodified'] = 'Last modified';
|
||||
$string['timeremaining'] = 'Time remaining';
|
||||
$string['ungroupedusers'] = 'The setting \'Require group to make submission\' is turned on and some users are not allocated to groups or are allocated to multiple groups, this will prevent them from submitting assignments.';
|
||||
$string['ungroupedusers'] = 'The setting \'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions.';
|
||||
$string['unlocksubmissionforstudent'] = 'Allow submissions for student: (id={$a->id}, fullname={$a->fullname}).';
|
||||
$string['unlocksubmissions'] = 'Unlock submissions';
|
||||
$string['unlimitedattempts'] = 'Unlimited';
|
||||
|
||||
@@ -2323,7 +2323,7 @@ class assign {
|
||||
* @param int $userid Teh id of the user who's groups we are checking
|
||||
* @return array The group objects
|
||||
*/
|
||||
protected function get_all_groups($userid) {
|
||||
public function get_all_groups($userid) {
|
||||
if (isset($this->usergroups[$userid])) {
|
||||
return $this->usergroups[$userid];
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ Feature: Submit assignment without group
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Allow default group"
|
||||
Then I should not see "You're not a member of any group, please contact your teacher."
|
||||
Then I should not see "Not a member of any group"
|
||||
And I should see "Nothing has been submitted for this assignment"
|
||||
And I press "Add submission"
|
||||
And I set the following fields to these values:
|
||||
@@ -58,13 +58,13 @@ Feature: Submit assignment without group
|
||||
And I should see "Submitted for grading"
|
||||
And I follow "Course 1"
|
||||
And I follow "Require group membership"
|
||||
And I should see "You're not a member of any group, please contact your teacher."
|
||||
And I should see "Not a member of any group"
|
||||
And I should see "Nothing has been submitted for this assignment"
|
||||
And I should not see "Add submission"
|
||||
And I am on homepage
|
||||
And I follow "Course 2"
|
||||
And I follow "Require group membership"
|
||||
And I should not see "You're not a member of any group, please contact your teacher."
|
||||
And I should not see "Not a member of any group"
|
||||
And I should see "Nothing has been submitted for this assignment"
|
||||
And I press "Add submission"
|
||||
And I set the following fields to these values:
|
||||
@@ -89,7 +89,7 @@ Feature: Submit assignment without group
|
||||
And I follow "Course 1"
|
||||
And I follow "Allow default group"
|
||||
And I should see "1" in the "Groups" "table_row"
|
||||
And I should not see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups or are allocated to multiple groups, this will prevent them from submitting assignments."
|
||||
And I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I follow "View/grade all submissions"
|
||||
And I should see "Default group" in the "Student 1" "table_row"
|
||||
And I should see "Default group" in the "Student 2" "table_row"
|
||||
@@ -99,17 +99,17 @@ Feature: Submit assignment without group
|
||||
And I follow "Course 1"
|
||||
And I follow "Require group membership"
|
||||
And I should see "0" in the "Groups" "table_row"
|
||||
And I should see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups or are allocated to multiple groups, this will prevent them from submitting assignments."
|
||||
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I follow "View/grade all submissions"
|
||||
And I should see "Default group" in the "Student 1" "table_row"
|
||||
And I should see "Default group" in the "Student 2" "table_row"
|
||||
And I should see "Not a member of any group, so unable to make submissions." in the "Student 1" "table_row"
|
||||
And I should see "Not a member of any group, so unable to make submissions." in the "Student 2" "table_row"
|
||||
And I should not see "Submitted for grading" in the "Student 1" "table_row"
|
||||
And I should not see "Submitted for grading" in the "Student 2" "table_row"
|
||||
And I am on homepage
|
||||
And I follow "Course 2"
|
||||
And I follow "Require group membership"
|
||||
And I should see "1" in the "Groups" "table_row"
|
||||
And I should not see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups or are allocated to multiple groups, this will prevent them from submitting assignments."
|
||||
And I should not see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I follow "View/grade all submissions"
|
||||
And I should see "Group 1" in the "Student 1" "table_row"
|
||||
And I should see "Group 1" in the "Student 2" "table_row"
|
||||
@@ -120,11 +120,13 @@ Feature: Submit assignment without group
|
||||
And I log in as "student3"
|
||||
And I follow "Course 3"
|
||||
And I follow "Require group membership"
|
||||
And I should see "You're a member of multiple groups, please contact your teacher."
|
||||
And I should see "Member of more than one group"
|
||||
And I should see "Nothing has been submitted for this assignment"
|
||||
And I should not see "Add submission"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Course 3"
|
||||
And I follow "Require group membership"
|
||||
And I should see "The setting 'Require group to make submission' is turned on and some users are not allocated to groups or are allocated to multiple groups, this will prevent them from submitting assignments."
|
||||
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
|
||||
And I follow "View/grade all submissions"
|
||||
And I should see "Member of more than one group, so unable to make submissions." in the "Student 3" "table_row"
|
||||
|
||||
Reference in New Issue
Block a user