MDL-65029 questions: refactor generation of question div id
We are planning to change the id in Moodle 3.7. However, the new method name has been back-ported to stable branches, because we know a lot of third-party question types like to have a single branch which supports multiple Moodle versions.
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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user