MDL-45037 gradebook: Allow dashes in xml grade values to be ignored.
This was delivering an error message when trying to import an exported xml file (from Moodle).
This commit is contained in:
@@ -82,7 +82,7 @@ function import_xml_grades($text, $course, &$error) {
|
||||
$newgrade->importer = $USER->id;
|
||||
|
||||
// check grade value exists and is a numeric grade
|
||||
if (isset($result['#']['score'][0]['#'])) {
|
||||
if (isset($result['#']['score'][0]['#']) && $result['#']['score'][0]['#'] !== '-') {
|
||||
if (is_numeric($result['#']['score'][0]['#'])) {
|
||||
$newgrade->finalgrade = $result['#']['score'][0]['#'];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user