Merge branch 'MDL-66203-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE

This commit is contained in:
Andrew Nicols
2021-10-11 08:36:54 +08:00
2 changed files with 16 additions and 2 deletions
+10 -2
View File
@@ -5947,7 +5947,7 @@ class assign {
$allsubmitted = true;
$anysubmitted = false;
$result = true;
if ($submission->status != ASSIGN_SUBMISSION_STATUS_REOPENED) {
if (!in_array($submission->status, [ASSIGN_SUBMISSION_STATUS_NEW, ASSIGN_SUBMISSION_STATUS_REOPENED])) {
foreach ($team as $member) {
$membersubmission = $this->get_user_submission($member->id, false, $submission->attemptnumber);
@@ -5981,7 +5981,7 @@ class assign {
// Set the group submission to reopened.
foreach ($team as $member) {
$membersubmission = $this->get_user_submission($member->id, true, $submission->attemptnumber);
$membersubmission->status = ASSIGN_SUBMISSION_STATUS_REOPENED;
$membersubmission->status = $submission->status;
$result = $DB->update_record('assign_submission', $membersubmission) && $result;
}
$result = $DB->update_record('assign_submission', $submission) && $result;
@@ -8083,6 +8083,8 @@ class assign {
if (!$submission) {
return false;
}
$submission->status = $submission->attemptnumber ? ASSIGN_SUBMISSION_STATUS_REOPENED : ASSIGN_SUBMISSION_STATUS_NEW;
$this->update_submission($submission, $userid, false, $this->get_instance()->teamsubmission);
// Tell each submission plugin we were saved with no data.
$plugins = $this->get_submission_plugins();
@@ -8092,6 +8094,12 @@ class assign {
}
}
$completion = new completion_info($this->get_course());
if ($completion->is_enabled($this->get_course_module()) &&
$this->get_instance()->completionsubmit) {
$completion->update_state($this->get_course_module(), COMPLETION_INCOMPLETE, $userid);
}
if ($submission->userid != 0) {
\mod_assign\event\submission_status_updated::create_from_submission($this, $submission)->trigger();
}
@@ -51,10 +51,12 @@ Feature: Remove a submission
When I follow "Remove submission"
And I click on "Continue" "button"
Then I should not see "I'm the student submission"
And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
And I log out
And I am on the "Test assignment name" Activity page logged in as student1
And I should not see "I'm the student submission"
And I should see "No attempt" in the "Submission status" "table_row"
@javascript @skip_chrome_zerosize
Scenario: Remove a group submission should remove the data from all group members
@@ -77,10 +79,12 @@ Feature: Remove a submission
When I follow "Remove submission"
And I click on "Continue" "button"
Then I should not see "I'm the student submission"
And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
And I log out
And I am on the "Test assignment name" Activity page logged in as student2
And I should not see "I'm the student submission"
And I should see "Nothing has been submitted for this assignment" in the "Submission status" "table_row"
@javascript @skip_chrome_zerosize
Scenario: A student can remove their own submission
@@ -104,7 +108,9 @@ Feature: Remove a submission
When I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "View all submissions" in current page administration
Then I should not see "I'm the student submission"
And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
And I log out
And I am on the "Test assignment name" Activity page logged in as student1
And I should not see "I'm the student submission"
And I should see "No attempt" in the "Submission status" "table_row"