MDL-81713 mod_quiz: Add random question 'Parent category' help icon.

This commit is contained in:
Luca Bösch 2024-05-08 12:26:54 +02:00 committed by Jun Pataleta
parent 67b2c43225
commit 697815159f
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
3 changed files with 20 additions and 0 deletions

View File

@ -2405,6 +2405,9 @@ function mod_quiz_output_fragment_add_random_question_form($args) {
'questioncategoryoptions' => $catoptions,
];
$helpicon = new \help_icon('parentcategory', 'question');
$data['questioncategoryhelp'] = $helpicon->export_for_template($renderer);
$result = $OUTPUT->render_from_template('mod_quiz/add_random_question_form', $data);
return $result;

View File

@ -33,6 +33,19 @@
{"name": "Category 3", "value": "2"}
]
},
"questioncategoryhelp": {
"title": "Help with something",
"text": "Help with something",
"url": "http://example.org/help",
"linktext": "",
"icon": {
"extraclasses": "iconhelp",
"attributes": [
{"name": "src", "value": "../../../pix/help.svg"},
{"name": "alt", "value": "Help icon"}
]
}
},
"questionbank": "<pre>Question bank HTML goes here</pre>"
}
}}
@ -70,6 +83,9 @@
<!-- Select number of random question -->
<label class="mr-md-2 mb-md-0" for="parentcategory">{{#str}} parentcategory, question {{/str}} </label>
{{#questioncategoryhelp}}
{{>core/help_icon}}
{{/questioncategoryhelp}}
<select id="parentcategory" name="parentcategory" class="form-control">
{{#questioncategoryoptions}}
<optgroup label="{{label}}">

View File

@ -98,6 +98,7 @@ Feature: Adding random questions to a quiz based on category and tags
When I open the "last" add to quiz menu
And I follow "a random question"
And I follow "New category"
And "Help with Parent category" "icon" should exist in the "id_newcategoryheader" "fieldset"
And I set the following fields to these values:
| Name | New Random category |
| Parent category | Default for Quiz 1 |