Merge branch 'MDL-65029_35' of git://github.com/timhunt/moodle into MOODLE_35_STABLE
This commit is contained in:
@@ -359,6 +359,19 @@ class question_attempt {
|
||||
return 'q' . $this->usageid . ':' . $this->slot . '_';
|
||||
}
|
||||
|
||||
/**
|
||||
* When the question is rendered, this unique id is added to the
|
||||
* outer div of the question. It can be used to uniquely reference
|
||||
* the question from JavaScript.
|
||||
*
|
||||
* Note, this is not truly unique. It will be changed in Moodle 3.7. See MDL-65029.
|
||||
*
|
||||
* @return string id added to the outer <div class="que ..."> when the question is rendered.
|
||||
*/
|
||||
public function get_outer_question_div_unique_id() {
|
||||
return 'q' . $this->slot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get one of the steps in this attempt.
|
||||
*
|
||||
|
||||
@@ -89,7 +89,7 @@ class core_question_renderer extends plugin_renderer_base {
|
||||
|
||||
$output = '';
|
||||
$output .= html_writer::start_tag('div', array(
|
||||
'id' => 'q' . $qa->get_slot(),
|
||||
'id' => $qa->get_outer_question_div_unique_id(),
|
||||
'class' => implode(' ', array(
|
||||
'que',
|
||||
$qa->get_question()->qtype->name(),
|
||||
|
||||
@@ -112,7 +112,7 @@ class qtype_ddtoimage_renderer_base extends qtype_with_combined_feedback_rendere
|
||||
}
|
||||
$output .= html_writer::tag('div',
|
||||
$droparea . $dragitems . $dropzones . $hiddens, array('class' => 'ddarea'));
|
||||
$topnode = 'div#q'.$qa->get_slot().' div.ddarea';
|
||||
$topnode = 'div#' . $qa->get_outer_question_div_unique_id() . ' div.ddarea';
|
||||
$params = array('drops' => $question->places,
|
||||
'topnode' => $topnode,
|
||||
'readonly' => $options->readonly);
|
||||
|
||||
@@ -96,7 +96,7 @@ class qtype_ddmarker_renderer extends qtype_ddtoimage_renderer_base {
|
||||
$visibledropzones = array();
|
||||
}
|
||||
|
||||
$topnode = 'div#q'.$qa->get_slot();
|
||||
$topnode = 'div#' . $qa->get_outer_question_div_unique_id();
|
||||
$params = array('dropzones' => $visibledropzones,
|
||||
'topnode' => $topnode,
|
||||
'readonly' => $options->readonly);
|
||||
|
||||
@@ -54,7 +54,7 @@ class qtype_ddwtos_renderer extends qtype_elements_embedded_in_question_text_ren
|
||||
|
||||
$params = array(
|
||||
'inputids' => $inputids,
|
||||
'topnode' => 'div.que.ddwtos#q' . $qa->get_slot(),
|
||||
'topnode' => 'div.que.ddwtos#' . $qa->get_outer_question_div_unique_id(),
|
||||
'readonly' => $options->readonly
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user