MDL-47494 gapselect: NOBUG cannot select id with ':' in YUI3.

Moved calculation of id to a new method so that I can fetch it and pass it to
ddwtos js.
This commit is contained in:
Jamie Pratt
2011-10-06 16:19:21 +07:00
parent 769fd123e4
commit 0f5bb17587
+5 -1
View File
@@ -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);