MDL-65029 questions: change question div id to acutally be unique

This is largely based on Simey Lameze's work.
This commit is contained in:
Tim Hunt
2019-03-29 13:37:44 +00:00
parent 0920f35ed9
commit f1ffd134d3
6 changed files with 28 additions and 4 deletions
+11
View File
@@ -359,6 +359,17 @@ 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.
*
* @return string id added to the outer <div class="que ..."> when the question is rendered.
*/
public function get_outer_question_div_unique_id() {
return 'question-' . $this->usageid . '-' . $this->slot;
}
/**
* Get one of the steps in this attempt.
*