mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'MDL-64161-master' of git://github.com/abgreeve/moodle
This commit is contained in:
commit
d9c72b7df9
2 changed files with 11 additions and 1 deletions
|
@ -289,6 +289,8 @@ abstract class screen {
|
||||||
$progressbar->start_html();
|
$progressbar->start_html();
|
||||||
$progressbar->start_progress(get_string('savegrades', 'gradereport_singleview'), count((array) $data) - 1);
|
$progressbar->start_progress(get_string('savegrades', 'gradereport_singleview'), count((array) $data) - 1);
|
||||||
$changecount = array();
|
$changecount = array();
|
||||||
|
// This array is used to determine if the override should be excluded from being counted as a change.
|
||||||
|
$ignorevalues = [];
|
||||||
|
|
||||||
foreach ($data as $varname => $throw) {
|
foreach ($data as $varname => $throw) {
|
||||||
$progressbar->progress($progress);
|
$progressbar->progress($progress);
|
||||||
|
@ -351,15 +353,23 @@ abstract class screen {
|
||||||
}
|
}
|
||||||
|
|
||||||
$msg = $element->set($posted);
|
$msg = $element->set($posted);
|
||||||
|
// Value to check against our list of matchelements to ignore.
|
||||||
|
$check = explode('_', $varname, 2);
|
||||||
|
|
||||||
// Optional type.
|
// Optional type.
|
||||||
if (!empty($msg)) {
|
if (!empty($msg)) {
|
||||||
$warnings[] = $msg;
|
$warnings[] = $msg;
|
||||||
if ($element instanceof \gradereport_singleview\local\ui\finalgrade) {
|
if ($element instanceof \gradereport_singleview\local\ui\finalgrade) {
|
||||||
|
// Add this value to this list so that the override object that is coming next will also be skipped.
|
||||||
|
$ignorevalues[$check[1]] = $check[1];
|
||||||
// This item wasn't changed so don't add to the changecount.
|
// This item wasn't changed so don't add to the changecount.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Check to see if this value has already been skipped.
|
||||||
|
if (array_key_exists($check[1], $ignorevalues)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (preg_match('/_(\d+)_(\d+)/', $varname, $matchelement)) {
|
if (preg_match('/_(\d+)_(\d+)/', $varname, $matchelement)) {
|
||||||
$changecount[$matchelement[0]] = 1;
|
$changecount[$matchelement[0]] = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ Feature: We can use Single view
|
||||||
And I set the field "Insert value" to "1.0"
|
And I set the field "Insert value" to "1.0"
|
||||||
And I set the field "Perform bulk insert" to "1"
|
And I set the field "Perform bulk insert" to "1"
|
||||||
And I press "Save"
|
And I press "Save"
|
||||||
Then I should see "Grades were set for 8 items"
|
Then I should see "Grades were set for 6 items"
|
||||||
|
|
||||||
Scenario: Navigation works in the Single view.
|
Scenario: Navigation works in the Single view.
|
||||||
Given I follow "Single view for Student 1"
|
Given I follow "Single view for Student 1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue