Skip to content

Commit

Permalink
MDL-56449 mod_assign: fuller description of group submission problems
Browse files Browse the repository at this point in the history
  • Loading branch information
davosmith committed Jan 4, 2017
1 parent c4cf1c6 commit e7f3fd5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mod/assign/lang/en/assign.php
Expand Up @@ -314,6 +314,7 @@
$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';
Expand All @@ -332,6 +333,7 @@
$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';
Expand Down
4 changes: 4 additions & 0 deletions mod/assign/renderer.php
Expand Up @@ -635,6 +635,7 @@ public function render_assign_submission_status(assign_submission_status $status

$t = new html_table();

$warningmsg = '';
if ($status->teamsubmissionenabled) {
$row = new html_table_row();
$cell1 = new html_table_cell(get_string('submissionteam', 'assign'));
Expand All @@ -646,10 +647,12 @@ public function render_assign_submission_status(assign_submission_status $status
$cell2 = new html_table_cell(
html_writer::span(get_string('noteam', 'assign'), 'alert alert-error')
);
$warningmsg = $this->output->notification(get_string('noteam_desc', 'assign'), 'error');
} else if (count($status->usergroups) > 1) {
$cell2 = new html_table_cell(
html_writer::span(get_string('multipleteams', 'assign'), 'alert alert-error')
);
$warningmsg = $this->output->notification(get_string('multipleteams_desc', 'assign'), 'error');
}
} else {
$cell2 = new html_table_cell(get_string('defaultteam', 'assign'));
Expand Down Expand Up @@ -906,6 +909,7 @@ public function render_assign_submission_status(assign_submission_status $status
}
}

$o .= $warningmsg;
$o .= html_writer::table($t);
$o .= $this->output->box_end();

Expand Down
3 changes: 3 additions & 0 deletions mod/assign/tests/behat/submit_without_group.feature
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e7f3fd5

Please sign in to comment.