mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Fix notice when you try to import an empty XML file.
This commit is contained in:
parent
5c88048813
commit
77e2e3f2b8
@ -37,7 +37,8 @@ function import_xml_grades($text, $course, &$error) {
|
||||
|
||||
$content = xmlize($text);
|
||||
|
||||
if ($results = $content['results']['#']['result']) {
|
||||
if (!empty($content['results']['#']['result'])) {
|
||||
$results = $content['results']['#']['result'];
|
||||
|
||||
foreach ($results as $i => $result) {
|
||||
if (!$grade_items = grade_item::fetch_all(array('idnumber'=>$result['#']['assignment'][0]['#'], 'courseid'=>$course->id))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user