}
foreach($this->matching_questions as $match_group) {
$question = $this->defaultquestion();
- $htmltext = $this->s(addslashes($match_group->questiontext));
+ $htmltext = s(addslashes($match_group->questiontext));
$question->questiontext = $htmltext;
$question->name = $question->questiontext;
$question->qtype = MATCH;
$htmltext = s(addslashes($value));
$question->subquestions[] = $htmltext;
- $htmltext = $this->s(addslashes($match_group->subanswers[$key]));
+ $htmltext = s(addslashes($match_group->subanswers[$key]));
$question->subanswers[] = $htmltext;
}
$questions[] = $question;
$type = trim($qrec['@']['type']);
$question = $this->defaultquestion();
- $question->qtype = $this->qtypes[$type];
+ if (array_key_exists($type, $this->qtypes)) {
+ $question->qtype = $this->qtypes[$type];
+ }
+ else {
+ $question->qtype = null;
+ }
$question->single = 1;
// Only one answer is allowed
$htmltext = $this->unxmlise($qrec['#']['text'][0]['#']);