Commit 79b717ec authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-56449_assign_groups' of git://github.com/davosmith/moodle

parents 34dc9284 255d3aaa
......@@ -314,6 +314,7 @@ $string['modulename_link'] = 'mod/assignment/view';
$string['modulenameplural'] = 'Assignments';
$string['moreusers'] = '{$a} more...';
$string['multipleteams'] = 'Member of more than one group';
$string['multipleteams_desc'] = 'The assignment requires submission in groups. You are a member of more than one group. To be able to submit you must be member of exactly one group so that your submission can be mapped correctly to your group. Please contact your teacher to update your group membership.';
$string['multipleteamsgrader'] = 'Member of more than one group, so unable to make submissions.';
$string['mysubmission'] = 'My submission: ';
$string['newsubmissions'] = 'Assignments submitted';
......@@ -332,6 +333,7 @@ $string['nosavebutnext'] = 'Next';
$string['nosubmission'] = 'Nothing has been submitted for this assignment';
$string['nosubmissionsacceptedafter'] = 'No submissions accepted after ';
$string['noteam'] = 'Not a member of any group';
$string['noteam_desc'] = 'This assignment requires submission in groups. You are not a member of any group, so you cannot create a submission. Please contact your teacher to be added to a group.';
$string['noteamgrader'] = 'Not a member of any group, so unable to make submissions.';
$string['notgraded'] = 'Not graded';
$string['notgradedyet'] = 'Not graded yet';
......
......@@ -635,6 +635,7 @@ class mod_assign_renderer extends plugin_renderer_base {
$t = new html_table();
$warningmsg = '';
if ($status->teamsubmissionenabled) {
$row = new html_table_row();
$cell1 = new html_table_cell(get_string('submissionteam', 'assign'));
......@@ -643,13 +644,19 @@ class mod_assign_renderer extends plugin_renderer_base {
$cell2 = new html_table_cell(format_string($group->name, false, $status->context));
} else if ($status->preventsubmissionnotingroup) {
if (count($status->usergroups) == 0) {
$notification = new \core\output\notification(get_string('noteam', 'assign'), 'error');
$notification->set_show_closebutton(false);
$cell2 = new html_table_cell(
html_writer::span(get_string('noteam', 'assign'), 'alert alert-error')
$this->output->render($notification)
);
$warningmsg = $this->output->notification(get_string('noteam_desc', 'assign'), 'error');
} else if (count($status->usergroups) > 1) {
$notification = new \core\output\notification(get_string('multipleteams', 'assign'), 'error');
$notification->set_show_closebutton(false);
$cell2 = new html_table_cell(
html_writer::span(get_string('multipleteams', 'assign'), 'alert alert-error')
$this->output->render($notification)
);
$warningmsg = $this->output->notification(get_string('multipleteams_desc', 'assign'), 'error');
}
} else {
$cell2 = new html_table_cell(get_string('defaultteam', 'assign'));
......@@ -906,6 +913,7 @@ class mod_assign_renderer extends plugin_renderer_base {
}
}
$o .= $warningmsg;
$o .= html_writer::table($t);
$o .= $this->output->box_end();
......
......@@ -48,6 +48,7 @@ Feature: Submit assignment without group
And I follow "Course 1"
And I follow "Allow default group"
Then I should not see "Not a member of any group"
And I should not see "This assignment requires submission in groups. You are 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:
......@@ -59,6 +60,7 @@ Feature: Submit assignment without group
And I follow "Course 1"
And I follow "Require group membership"
And I should see "Not a member of any group"
And I should see "This assignment requires submission in groups. You are 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
......@@ -121,6 +123,7 @@ Feature: Submit assignment without group
And I follow "Course 3"
And I follow "Require group membership"
And I should see "Member of more than one group"
And I should see "The assignment requires submission in groups. You are a 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment