You are here

function qformat_examview::parse_ma in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/examview/format.php \qformat_examview::parse_ma()
1 call to qformat_examview::parse_ma()
qformat_examview::readquestion in includes/moodle/question/format/examview/format.php
Given the data known to define a question in this format, this function converts it into a question object suitable for processing and insertion into Moodle.

File

includes/moodle/question/format/examview/format.php, line 85

Class

qformat_examview

Code

function parse_ma($qrec, $groupname) {
  $match_group = $this->matching_questions[$groupname];
  $phrase = trim($this
    ->unxmlise($qrec['text']['0']['#']));
  $answer = trim($this
    ->unxmlise($qrec['answer']['0']['#']));
  $answer = strip_tags($answer);
  $match_group->subquestions[] = $phrase;
  $match_group->subanswers[] = $match_group->subchoices[$answer];
  $this->matching_questions[$groupname] = $match_group;
  return NULL;
}