Skip to content

Commit e8c5758

Browse files
authored
Added question name as data attribute for anchoring. This PR is made for #253 (#637)
1 parent c4dc5a9 commit e8c5758

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

classes/output/renderer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ public function question_output($question, $response, $qnum, $blankquestionnaire
244244
$pagetags->notifications = $this->notification($notification, \core\output\notification::NOTIFY_ERROR);
245245
}
246246
}
247-
247+
$pagetags->questionname = $question->name;
248+
248249
return $this->render_from_template('mod_questionnaire/question_container', $pagetags);
249250
}
250251

templates/question_container.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
{{{required}}}
5959
</div>
6060
{{/qnum}}
61-
<div class="qn-content">
61+
<div class="qn-content" {{#questionname}}data-question-name="{{questionname}}"{{/questionname}}>
6262
<div class="qn-question {{skippedclass}}">
6363
{{#label}}<label for="{{label.for}}">{{/label}}
6464
{{{qcontent}}}

0 commit comments

Comments
 (0)