From e7f3fd59d48fd3b6a33e640e7ce1cb1b53dd4b85 Mon Sep 17 00:00:00 2001 From: Davo Smith Date: Tue, 6 Dec 2016 13:03:01 +0000 Subject: [PATCH] MDL-56449 mod_assign: fuller description of group submission problems --- mod/assign/lang/en/assign.php | 2 ++ mod/assign/renderer.php | 4 ++++ mod/assign/tests/behat/submit_without_group.feature | 3 +++ 3 files changed, 9 insertions(+) diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index dabe025ccd630..893b4d88e4d71 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -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'; @@ -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'; diff --git a/mod/assign/renderer.php b/mod/assign/renderer.php index 665a0d3c002ec..d80634e969b54 100644 --- a/mod/assign/renderer.php +++ b/mod/assign/renderer.php @@ -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')); @@ -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')); @@ -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(); diff --git a/mod/assign/tests/behat/submit_without_group.feature b/mod/assign/tests/behat/submit_without_group.feature index 6c24033cbb43f..bffaf6503d9de 100644 --- a/mod/assign/tests/behat/submit_without_group.feature +++ b/mod/assign/tests/behat/submit_without_group.feature @@ -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