From a60b5c161f748f4557aff149833c788aef00d0a9 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Tue, 28 Nov 2006 09:28:33 +0000 Subject: [PATCH] Merged from STABLE. Fixed a typo and a notice --- question/format/examview/format.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/question/format/examview/format.php b/question/format/examview/format.php index ea7f08dc46..7032911e96 100755 --- a/question/format/examview/format.php +++ b/question/format/examview/format.php @@ -106,7 +106,7 @@ class qformat_examview extends qformat_default { } 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; @@ -116,7 +116,7 @@ class qformat_examview extends qformat_default { $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; @@ -160,7 +160,12 @@ class qformat_examview extends qformat_default { $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]['#']); -- 2.39.5