mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
Merge branch 'MDL-64161-35' of git://github.com/abgreeve/moodle into MOODLE_35_STABLE
This commit is contained in:
commit
c7390b1c4f
3 changed files with 21 additions and 1 deletions
|
@ -355,6 +355,10 @@ abstract class screen {
|
||||||
// Optional type.
|
// Optional type.
|
||||||
if (!empty($msg)) {
|
if (!empty($msg)) {
|
||||||
$warnings[] = $msg;
|
$warnings[] = $msg;
|
||||||
|
if ($element instanceof \gradereport_singleview\local\ui\finalgrade) {
|
||||||
|
// This item wasn't changed so don't add to the changecount.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (preg_match('/_(\d+)_(\d+)/', $varname, $matchelement)) {
|
if (preg_match('/_(\d+)_(\d+)/', $varname, $matchelement)) {
|
||||||
$changecount[$matchelement[0]] = 1;
|
$changecount[$matchelement[0]] = 1;
|
||||||
|
|
|
@ -170,9 +170,11 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa
|
||||||
}
|
}
|
||||||
$gradestr->itemname = $this->grade->grade_item->get_name();
|
$gradestr->itemname = $this->grade->grade_item->get_name();
|
||||||
$errorstr = get_string($errorstr, 'grades', $gradestr);
|
$errorstr = get_string($errorstr, 'grades', $gradestr);
|
||||||
|
return $errorstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only update grades if there are no errors.
|
||||||
$gradeitem->update_final_grade($userid, $finalgrade, 'singleview', $feedback, FORMAT_MOODLE);
|
$gradeitem->update_final_grade($userid, $finalgrade, 'singleview', $feedback, FORMAT_MOODLE);
|
||||||
return $errorstr;
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,3 +101,17 @@ Feature: We can bulk insert grades for students in a course
|
||||||
And the field "Override for Test assignment three" matches value "1"
|
And the field "Override for Test assignment three" matches value "1"
|
||||||
And the field "Grade for Test assignment four" matches value "1.00"
|
And the field "Grade for Test assignment four" matches value "1.00"
|
||||||
And the field "Override for Test assignment four" matches value "1"
|
And the field "Override for Test assignment four" matches value "1"
|
||||||
|
|
||||||
|
Scenario: I can not update grades if the value is out of bounds.
|
||||||
|
Given I log in as "teacher1"
|
||||||
|
And I am on "Course 1" course homepage
|
||||||
|
And I navigate to "View > Grader report" in the course gradebook
|
||||||
|
And I follow "Single view for Test assignment one"
|
||||||
|
And I set the field "Perform bulk insert" to "1"
|
||||||
|
When I set the field "Insert value" to "-1"
|
||||||
|
And I press "Save"
|
||||||
|
Then I should see "The grade entered for Test assignment one for james (Student) 1 is less than the minimum allowed"
|
||||||
|
And I should see "The grade entered for Test assignment one for holly (Student) 2 is less than the minimum allowed"
|
||||||
|
And I should see "The grade entered for Test assignment one for anna (Student) 3 is less than the minimum allowed"
|
||||||
|
And I should see "The grade entered for Test assignment one for zac (Student) 4 is less than the minimum allowed"
|
||||||
|
And I should see "Grades were set for 0 items"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue