You are here

function qformat_qti2::export_quiz in Quiz 6.6

Same name and namespace in other branches
  1. 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


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):


includes/moodle/question/format/qti2/format.php, line 334




function export_quiz($course, $quiz, $questions, $result, $redirect, $submiturl = null) {
  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);