MDL-57222 mod_assign: show validation message on visible element

This commit is contained in:
Mark Nelson 2016-12-09 16:08:46 +08:00
parent 5ef81f2b0b
commit 3b5b35a326
6 changed files with 12 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class mod_assign_grade_form extends moodleform {
if ($instance->markingworkflow && !empty($data['sendstudentnotifications']) &&
$data['workflowstate'] != ASSIGN_MARKING_WORKFLOW_STATE_RELEASED) {
$errors['sendstudentnotifications'] = get_string('studentnotificationworkflowstateerror', 'assign');
$errors['workflowstate'] = get_string('studentnotificationworkflowstateerror', 'assign');
}
// Advanced grading.

View File

@ -7184,7 +7184,9 @@ class assign {
$mform->freeze('sendstudentnotifications');
} else if ($this->get_instance()->markingworkflow) {
$mform->setDefault('sendstudentnotifications', 0);
$mform->disabledIf('sendstudentnotifications', 'workflowstate', 'neq', ASSIGN_MARKING_WORKFLOW_STATE_RELEASED);
if (!$gradingpanel) {
$mform->disabledIf('sendstudentnotifications', 'workflowstate', 'neq', ASSIGN_MARKING_WORKFLOW_STATE_RELEASED);
}
} else {
$mform->setDefault('sendstudentnotifications', $this->get_instance()->sendstudentnotifications);
}

View File

@ -31,6 +31,7 @@ Feature: Check that the assignment grade can be updated correctly
Then I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
@ -67,6 +68,7 @@ Feature: Check that the assignment grade can be updated correctly
Then I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"

View File

@ -35,6 +35,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "allocatedmarker" to "Marker 1"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"

View File

@ -55,6 +55,7 @@ Feature: View the grading status of an assignment
And I set the field "Grade out of 100" to "50"
And I set the field "Marking workflow state" to "In review"
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
@ -105,6 +106,7 @@ Feature: View the grading status of an assignment
And I should see "Released" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Marking workflow state" to "In marking"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"

View File

@ -50,6 +50,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I set the field "Grade out of 100" to "50"
And I set the field "Marking workflow state" to "In review"
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
@ -61,6 +62,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
Scenario: Student identities are revealed after releasing the grades.
When I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
And I set the field "Marking workflow state" to "Ready for release"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"
@ -88,6 +90,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
Scenario: Student identities are revealed before releasing the grades.
When I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
And I set the field "Marking workflow state" to "Ready for release"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I click on "Edit settings" "link"