From 790eb7ee055b65e317557cb070246d6c71ecfafc Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 8 Jan 2015 21:47:02 -0800 Subject: [PATCH 1/2] MDL-40285 mod_assign: show details for all default group members --- mod/assign/gradingtable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index 7672b9d5906..09ef736e423 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -875,7 +875,7 @@ class assign_grading_table extends table_sql implements renderable { $group = false; $submission = false; $this->get_group_and_submission($row->id, $group, $submission, -1); - if ($group && $submission && $submission->timemodified) { + if ($submission && $submission->timemodified && $submission->status != ASSIGN_SUBMISSION_STATUS_NEW) { $o = userdate($submission->timemodified); } else if ($row->timesubmitted) { $o = userdate($row->timesubmitted); @@ -903,7 +903,7 @@ class assign_grading_table extends table_sql implements renderable { $group = false; $submission = false; $this->get_group_and_submission($row->id, $group, $submission, -1); - if ($group && $submission) { + if ($submission) { $timesubmitted = $submission->timemodified; $status = $submission->status; } else { From 041dd2902d4953c3e7cc41688482bf65e7667e56 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 30 Dec 2014 22:51:12 -0800 Subject: [PATCH 2/2] MDL-40285 mod_assign: added extra group submissions behat scenario Thanks a lot to Jody Steele for providing the basis for the scenario. --- .../tests/behat/group_submission.feature | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/mod/assign/tests/behat/group_submission.feature b/mod/assign/tests/behat/group_submission.feature index 37ac509d588..196bf97f4a7 100644 --- a/mod/assign/tests/behat/group_submission.feature +++ b/mod/assign/tests/behat/group_submission.feature @@ -63,3 +63,74 @@ Feature: Group assignment submissions And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exist And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exist And "//tr[contains(., 'Student 3')][contains(., 'Default group')]" "xpath_element" should exist + + @javascript + Scenario: Confirm that the grading status changes for each group member + Given the following "courses" exist: + | fullname | shortname | category | groupmode | + | Course 1 | C1 | 0 | 1 | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@asd.com | + | student1 | Student | 1 | student1@asd.com | + | student2 | Student | 2 | student2@asd.com | + | student3 | Student | 3 | student3@asd.com | + | student4 | Student | 4 | student4@asd.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | + | student3 | C1 | student | + | student4 | C1 | student | + And the following "groups" exist: + | name | course | idnumber | + | Group 1 | C1 | G1 | + And the following "group members" exist: + | user | group | + | student1 | G1 | + | student2 | G1 | + And I log in as "teacher1" + And I follow "Course 1" + And I turn editing mode on + And I add a "Assignment" to section "1" and I fill the form with: + | Assignment name | Test assignment name | + | Description | Test assignment description | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_file_enabled | 0 | + | Students submit in groups | Yes | + | Group mode | No groups | + And I log out + And I log in as "student1" + And I follow "Course 1" + And I follow "Test assignment name" + And I press "Add submission" + And I set the following fields to these values: + | Online text | I'm the student's first submission | + And I press "Save changes" + And I log out + And I log in as "teacher1" + And I follow "Course 1" + And I follow "Test assignment name" + When I follow "View/grade all submissions" + Then "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading" + And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading" + And "Student 3" row "Status" column of "generaltable" table should not contain "Submitted for grading" + And "Student 4" row "Status" column of "generaltable" table should not contain "Submitted for grading" + And I log out + And I log in as "student3" + And I follow "Course 1" + And I follow "Test assignment name" + And I press "Add submission" + And I set the following fields to these values: + | Online text | I'm the student's first submission | + And I press "Save changes" + And I log out + And I log in as "teacher1" + And I follow "Course 1" + And I follow "Test assignment name" + And I follow "View/grade all submissions" + And "Student 1" row "Status" column of "generaltable" table should contain "Submitted for grading" + And "Student 2" row "Status" column of "generaltable" table should contain "Submitted for grading" + And "Student 3" row "Status" column of "generaltable" table should contain "Submitted for grading" + And "Student 4" row "Status" column of "generaltable" table should contain "Submitted for grading"