Permalink
Browse files

MDL-19072 XHTML export for match questions fix for distractors

  • Loading branch information...
1 parent bd11908 commit 720b0f5eb00621c22756cb4262e4b58108d5a602 Jean-Michel Vedrine committed Mar 31, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 question/format/xhtml/format.php
@@ -130,11 +130,13 @@ protected function writequestion($question) {
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;

0 comments on commit 720b0f5

Please sign in to comment.