Merge branch 'MDL-81713-403' of https://github.com/junpataleta/moodle into MOODLE_403_STABLE

This commit is contained in:
Jun Pataleta
2024-05-09 12:02:13 +08:00
3 changed files with 20 additions and 0 deletions
+3
View File
@@ -2480,6 +2480,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;
@@ -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}}">
@@ -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 "Random question using a new category" "fieldset"
And I set the following fields to these values:
| Name | New Random category |
| Parent category | Default for Quiz 1 |