}
}
+ $data = $this->getPageData();
+
// Create data.xml
$xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?><quiz />');
- $xml->addAttribute('id', $this->getAttribute('id'));
- $xml->addChild('title', $this->getAttribute('title'));
- $xml->addChild('threshold', $this->getAttribute('threshold') ?: '0');
- $xml->addChild('instantReview', $this->getAttribute('instantReview') ? '1' : '0');
- $xml->addChild('review', $this->getAttribute('review') ? '1' : '0');
- $xml->addChild('logattempts', $this->getAttribute('logattempts') ? '1' : '0');
+ $xml->addAttribute('id', $data->get('id'));
+ $xml->addChild('title', $data->get('title'));
+ $xml->addChild('threshold', $data->get('threshold', '0') ?: '0');
+ $xml->addChild('instantReview', $data->get('instantReview', true) ? '1' : '0');
+ $xml->addChild('review', $data->get('review', true) ? '1' : '0');
+ $xml->addChild('logattempts', $data->get('logattempts', false) ? '1' : '0');
$xt = $xml->addChild('translations');
/** @var QuizTranslation $translation */
- $tid = $this->getAttribute('translation') ?? 1;
+ $tid = $data->get('translation',1) ?? 1;
if ($tid === 'en') {
$tid = 1;
}