You are here

function qformat_xml::import_multianswer in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/xml/format.php \qformat_xml::import_multianswer()

import cloze type question

Parameters

array question question array from xml tree:

Return value

object question object

1 call to qformat_xml::import_multianswer()
qformat_xml::readquestions in includes/moodle/question/format/xml/format.php
parse the array of lines into an array of questions this *could* burn memory - but it won't happen that much so fingers crossed!

File

includes/moodle/question/format/xml/format.php, line 208

Class

qformat_xml

Code

function import_multianswer($questions) {
  $questiontext = $questions['#']['questiontext'][0]['#']['text'];
  $qo = qtype_multianswer_extract_question($this
    ->import_text($questiontext));

  // 'header' parts particular to multianswer
  $qo->qtype = MULTIANSWER;
  $qo->course = $this->course;
  $qo->generalfeedback = $this
    ->getpath($questions, array(
    '#',
    'generalfeedback',
    0,
    '#',
    'text',
    0,
    '#',
  ), '', true);
  if (!empty($questions)) {
    $qo->name = $this
      ->import_text($questions['#']['name'][0]['#']['text']);
  }
  return $qo;
}