Permalink
Browse files

MDL-19072 XHTML export for match questions fix for distractors

  • Loading branch information...
1 parent 7d253e0 commit 59b50da6e9454e5bcdbeff6ff10dcac35b90953f Jean-Michel Vedrine committed Apr 9, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 question/format/xhtml/format.php
@@ -126,11 +126,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 .= "<select id=\"quest_{$id}_{$option}\" name=\"quest_{$id}_{$option}\">\n".$selectoptions."</select>\n";
- $expout .= " <li>$quest_text</li>\n";
- $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 .= "<select id=\"quest_{$id}_{$option}\" name=\"quest_{$id}_{$option}\">\n".$selectoptions."</select>\n";
+ $expout .= " <li>$quest_text</li>\n";
+ $expout .= $dropdown;
+ $option++;
+ }
}
$expout .= "</ul>\n";
break;

0 comments on commit 59b50da

Please sign in to comment.