MDL-46308 qformat_xml: fix import of broken calculated questions.
Questions like this should not exist, of course. But they do, so we should avoid generating errors in this case.
This commit is contained in:
@@ -856,9 +856,10 @@ class qformat_xml extends qformat_default {
|
||||
$qo->dataset[$qo->datasetindex]->itemcount = $dataset['#']['itemcount'][0]['#'];
|
||||
$qo->dataset[$qo->datasetindex]->datasetitem = array();
|
||||
$qo->dataset[$qo->datasetindex]->itemindex = 0;
|
||||
$qo->dataset[$qo->datasetindex]->number_of_items =
|
||||
$dataset['#']['number_of_items'][0]['#'];
|
||||
$datasetitems = $dataset['#']['dataset_items'][0]['#']['dataset_item'];
|
||||
$qo->dataset[$qo->datasetindex]->number_of_items = $this->getpath($dataset,
|
||||
array('#', 'number_of_items', 0, '#'), 0);
|
||||
$datasetitems = $this->getpath($dataset,
|
||||
array('#', 'dataset_items', 0, '#', 'dataset_item'), array());
|
||||
foreach ($datasetitems as $datasetitem) {
|
||||
$qo->dataset[$qo->datasetindex]->itemindex++;
|
||||
$qo->dataset[$qo->datasetindex]->datasetitem[
|
||||
|
||||
Reference in New Issue
Block a user