From 1e8f4e54c7edd21ce1122db283f63801a74f7ac0 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Sun, 31 Mar 2013 15:13:44 +0200 Subject: [PATCH] MDL-19072 XHTML export for match questions fix for distractors --- question/format/xhtml/format.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/question/format/xhtml/format.php b/question/format/xhtml/format.php index 256db705340..21db81d0951 100644 --- a/question/format/xhtml/format.php +++ b/question/format/xhtml/format.php @@ -130,11 +130,13 @@ class qformat_xhtml extends qformat_default { foreach($question->options->subquestions as $subquestion) { // build drop down for answers $quest_text = $this->repchar( $subquestion->questiontext ); - $dropdown = html_writer::label(get_string('answer', 'qtype_match', $option+1), 'quest_'.$id.'_'.$option, false, array('class' => 'accesshide')); - $dropdown .= html_writer::select($selectoptions, "quest_{$id}_{$option}", '', false, array('id' => "quest_{$id}_{$option}")); - $expout .= html_writer::tag('li', $quest_text); - $expout .= $dropdown; - $option++; + if ($quest_text != '') { + $dropdown = html_writer::label(get_string('answer', 'qtype_match', $option+1), 'quest_'.$id.'_'.$option, false, array('class' => 'accesshide')); + $dropdown .= html_writer::select($selectoptions, "quest_{$id}_{$option}", '', false, array('id' => "quest_{$id}_{$option}")); + $expout .= html_writer::tag('li', $quest_text); + $expout .= $dropdown; + $option++; + } } $expout .= html_writer::end_tag('ul'); break;