MDL-47494 gapselect: Merge branch 'master' of git://github.com/timhunt/moodle-qtype_g...
authorJamie Pratt <me@jamiep.org>
Thu, 13 Oct 2011 12:07:43 +0000 (19:07 +0700)
committerJamie Pratt <me@jamiep.org>
Thu, 13 Oct 2011 12:07:43 +0000 (19:07 +0700)
question/type/gapselect/rendererbase.php

index fae921e..49c44cf 100755 (executable)
@@ -52,7 +52,7 @@ abstract class qtype_elements_embedded_in_question_text_renderer
         $result = '';
         $result .= html_writer::tag('div', $question->format_text($questiontext,
                 $question->questiontextformat, $qa, 'question', 'questiontext', $question->id),
-                array('class' => $this->qtext_classname(), 'id' => $qa->get_qt_field_name('')));
+                array('class' => $this->qtext_classname(), 'id' => $this->qtext_id($qa)));
 
         $result .= $this->post_qtext_elements($qa, $options);
 
@@ -69,6 +69,10 @@ abstract class qtype_elements_embedded_in_question_text_renderer
         return 'qtext';
     }
 
+    protected function qtext_id($qa) {
+        return str_replace(':', '_', $qa->get_qt_field_name(''));
+    }
+
     protected abstract function embedded_element(question_attempt $qa, $place,
             question_display_options $options);