You are here

function qformat_qti2::questions_with_export_info in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/qti2/format.php \qformat_qti2::questions_with_export_info()

adds exporttext property to the questions

Adds the qti export text to the questions

Parameters

array $questions - an array of question objects:

Return value

an array of question objects

1 call to qformat_qti2::questions_with_export_info()
qformat_qti2::quiz_export_prepare_questions in includes/moodle/question/format/qti2/format.php
Prepares questions for quiz export

File

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

Class

qformat_qti2

Code

function questions_with_export_info($questions, $shuffleanswers = null) {
  $exportquestions = array();
  foreach ($questions as $key => $question) {
    $expout = $this
      ->writequestion($question, $shuffleanswers) . "\n";
    $expout = $this
      ->presave_process($expout);
    $key = $this
      ->get_assesment_item_id($question);
    $exportquestions[$key] = $question;
    $exportquestions[$key]->exporttext = $expout;
  }
  return $exportquestions;
}