function qformat_qti2::export_quiz in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/question/format/qti2/format.php \qformat_qti2::export_quiz()
exports a quiz (as opposed to exporting a category of questions)
The parent class method was overridden because the IMS export consists of multiple files
@todo use $result in the ouput
Parameters
object $quiz:
array $questions - an array of question objects:
object $result - if set, contains result of calling quiz_grade_responses():
string $redirect - a URL to redirect to in case of failure:
string $submiturl - the URL for the qti player to send the results to (e.g. attempt.php):
File
- includes/
moodle/ question/ format/ qti2/ format.php, line 334
Class
Code
function export_quiz($course, $quiz, $questions, $result, $redirect, $submiturl = null) {
$this
->xml_entitize($course);
$this
->xml_entitize($quiz);
$this
->xml_entitize($questions);
$this
->xml_entitize($result);
$this
->xml_entitize($submiturl);
if (!$this
->exportpreprocess(0, $course)) {
// Do anything before that we need to
error("Error occurred during pre-processing!", $redirect);
}
if (!$this
->exportprocess_quiz($quiz, $questions, $result, $submiturl, $course)) {
// Process the export data
error("Error occurred during processing!", $redirect);
}
if (!$this
->exportpostprocess()) {
// In case anything needs to be done after
error("Error occurred during post-processing!", $redirect);
}
}