first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,118 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/add_random_question_form
From to add random questions.
Example context (json):
{
"returnurl": "http://example.com",
"randomoptions": [
{"name": "1", "value": "1"},
{"name": "2", "value": "2"}
],
"questioncategoryoptions": {
"label": "Category 1",
"options": [
{"name": "Category 2", "value": "1"},
{"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>"
}
}}
<div class="mt-2 position-relative" data-region="add_random_question_form-container">
<form action="{{returnurl}}" method="POST" id="add_random_question_form" class="mform">
<fieldset id="id_existingcategoryheader">
<legend>{{#str}} randomfromexistingcategory, mod_quiz {{/str}}</legend>
<!-- Question bank -->
{{{questionbank}}}
<!-- Select number of random question -->
<label>
{{#str}}randomnumber, mod_quiz{{/str}}
<select id="menurandomcount" name="randomcount" class="form-control custom-select">
{{#randomoptions}}
<option value="{{value}}">{{name}}</option>
{{/randomoptions}}
</select>
</label>
<!-- Buttons -->
<div class="modal-footer mt-1" data-region="footer">
<input type="hidden" name="message" value="">
<input type="submit" class="btn btn-primary" name="addrandom" value="{{#str}} addrandomquestion, mod_quiz {{/str}}">
<input type="submit" class="btn btn-secondary" name="cancel" value="{{#str}} cancel {{/str}}">
</div>
</fieldset>
<fieldset id="id_newcategoryheader">
<legend>{{#str}} randomquestionusinganewcategory, mod_quiz {{/str}}</legend>
<!-- New categoryname -->
<div class="mb-3 row fitem">
<div class="col-md-3 col-form-label d-flex pb-0 pr-md-0">
<label class="mr-md-2 mb-md-0" for="categoryname">{{#str}} name {{/str}} </label>
</div>
<div class="col-md-9 d-flex flex-wrap align-items-start felement" data-fieldtype="text">
<input type="text" class="form-control" id="categoryname" name="categoryname" maxlength="254" size="50">
</div>
</div>
<!-- Select parent of new category -->
<div class="mb-3 row fitem">
<div class="col-md-3 col-form-label d-flex pb-0 pr-md-0">
<label class="mr-md-2 mb-md-0" for="parentcategory">{{#str}} parentcategory, question {{/str}} </label>
{{#questioncategoryhelp}}
{{>core/help_icon}}
{{/questioncategoryhelp}}
</div>
<div class="col-md-9 d-flex flex-wrap align-items-start felement" data-fieldtype="select">
<select id="parentcategory" name="parentcategory" class="form-control">
{{#questioncategoryoptions}}
<optgroup label="{{label}}">
{{#options}}
<option value="{{value}}">{{{name}}}</option>
{{/options}}
</optgroup>
{{/questioncategoryoptions}}
</select>
</div>
</div>
<!-- Buttons -->
<div class="modal-footer mt-1" data-region="footer">
<input type="submit" class="btn btn-primary" name="newcategory" value="{{#str}} createcategoryandaddrandomquestion, mod_quiz {{/str}}">
<input type="submit" class="btn btn-secondary" name="cancel" value="{{#str}} cancel {{/str}}">
</div>
</fieldset>
</form>
</div>
@@ -0,0 +1,46 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/attempt_summary_information
This template renders summary information about a single quiz attempt.
Example context (json):
{
"hasitems": true,
"items": [
{
"title": "<img src='https://qa.moodledemo.net/pluginfile.php/27/user/icon/boost/f2?rev=5522' class='userpicture' width='35' height='35' alt='It is me!'>",
"content": "<a href='https://qa.moodledemo.net/user/view.php?id=4&amp;course=2'>Sam Student</a>"
},
{"title": "Status", "content": "Finished"},
{"title": "Started", "content": "Thursday, 23 November 2023, 9:29 AM"},
{"title": "Completed", "content": "Thursday, 23 November 2023, 9:32 AM"},
{"title": "Duration", "content": "3 minutes"},
{"title": "Grade", "content": "Not yet graded"}
]
}
}}
{{#hasitems}}
<table class="generaltable generalbox quizreviewsummary mb-0">
<tbody>
{{#items}}
<tr>
<th class="cell" scope="row">{{{title}}}</th>
<td class="cell">{{{content}}}</td>
</tr>
{{/items}}
</tbody>
</table>
{{/hasitems}}
@@ -0,0 +1,194 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/edit_grading_page
Display the Quiz complex grading page, from below tertiary nav, to above the footer.
Classes required for JS:
* none.
Data attributes required for JS:
* Many. See mod_quiz/edit_grading module.
Context variables required for this template:
* TBC
Example context (json):
{
"quizid": 42,
"hasgradeitems": true,
"gradeitems": [
{
"id": 123,
"sortorder": 1,
"name": "Reading & writing",
"displayname": "Reading &amp; writing",
"summarks": "10.00",
"isused": true
}
],
"hasslots": true,
"sections": [
{
"displayname": "Section title",
"slots": [
{
"id": 234,
"displaynumber": "1",
"displayname": "Question name",
"maxmark": "10.00",
"choices": [
{
"id": 0,
"choice": "[none]",
"isselected": false
},
{
"id": 123,
"choice": "Reading &amp; writing",
"isselected": true
}
]
}
]
}
],
"nogradeitems": {
"message": "This quiz does not yet have any grade items defined."
},
"noslots": {
"message": "No questions have been added to the quiz yet. Please add the questions to the quiz before setting up grading."
}
}
}}
<div id="edit_grading_page-contents">
<h2>{{#str}} gradeitemsetup, quiz {{/str}}</h2>
{{^hasgradeitems}}
{{#nogradeitems}}
{{> core/notification_info}}
{{/nogradeitems}}
{{/hasgradeitems}}
{{#hasgradeitems}}
<table class="generaltable table-responsive" id="mod_quiz-grade-item-list" data-quiz-id="{{quizid}}">
<caption class="sr-only"> {{#str}} gradeitems, grades {{/str}} </caption>
<thead>
<tr>
<th scope="col">{{#str}} gradeitem, grades {{/str}}</th>
<th scope="col">{{#str}} totalmarks, quiz {{/str}}</th>
<th scope="col">{{#str}} actions {{/str}}</th>
</tr>
</thead>
<tbody>
{{#gradeitems}}
<tr data-quiz-grade-item-id="{{id}}">
<th scope="row" class="align-middle font-weight-normal py-1">
<span class="inplaceeditable inplaceeditable-text w-100"
data-raw-name="{{name}}" data-edit-label="{{#str}} gradeitemnewname, quiz, {{{displayname}}} {{/str}}">
<a href="#" class="quickeditlink w-100" data-action-edit="1" title="{{#str}} gradeitemedit, quiz, {{{displayname}}} {{/str}}">
<span class="displayvalue">{{{displayname}}}</span>
<span class="quickediticon">
{{#pix}}t/editstring, core{{/pix}}
</span>
</a>
</span>
</th>
<td class="align-middle text-right py-1">
{{summarks}}
</td>
<td class="align-middle text-center py-1">
{{^isused}}
<a href="#" data-action-delete="1">
{{#pix}} t/delete, core, {{#str}} gradeitemdelete, quiz, {{{name}}} {{/str}} {{/pix}}
</a>
{{/isused}}
</td>
</tr>
{{/gradeitems}}
</tbody>
</table>
{{/hasgradeitems}}
<div class="mb-5">
<button type="button" class="btn btn-secondary" id="mod_quiz-add_grade_item"
data-quiz-id="{{quizid}}">{{#str}} additem, grades{{/str}}</button>
{{^hasgradeitems}}
{{#hasmultiplesections}}
<button type="button" class="btn btn-secondary" id="mod_quiz-grades_auto_setup"
data-quiz-id="{{quizid}}">{{#str}} gradeitemsautosetup, quiz{{/str}}</button>
{{/hasmultiplesections}}
{{/hasgradeitems}}
</div>
<h3>{{#str}} gradeitemmarkscheme, quiz {{/str}}</h3>
{{^hasslots}}
{{#noslots}}
{{> core/notification_info}}
{{/noslots}}
{{/hasslots}}
{{#hasslots}}
<table class="generaltable table-responsive" id="mod_quiz-slot-list" data-quiz-id="{{quizid}}">
<caption class="sr-only"> {{#str}} gradeitemmarkscheme, quiz {{/str}} </caption>
<thead>
<tr>
<th scope="col">{{#str}} numberabbr, quiz {{/str}}</th>
<th scope="col">{{#str}} question, quiz {{/str}}</th>
<th scope="col">{{#str}} marks, quiz {{/str}}</th>
<th scope="col">{{#str}} gradeitem, grades {{/str}}</th>
</tr>
</thead>
<tbody>
{{#sections}}
<tr class="mod_quiz-new-section">
<td colspan="4">
<h4>{{{displayname}}}</h4>
</td>
</tr>
{{#slots}}
<tr>
<td class="align-middle py-1">{{displaynumber}}</td>
<th scope="row" class="align-middle py-1"><label for="grade-item-choice-{{id}}" class="my-1">{{{displayname}}}</label></th>
<td class="align-middle text-right py-1">{{maxmark}}</td>
<td class="align-middle py-1">
<select id="grade-item-choice-{{id}}" class="form-control" data-slot-id="{{id}}">
{{#choices}}
<option value="{{id}}"{{#isselected}} selected="selected"{{/isselected}}>{{{choice}}}</option>
{{/choices}}
</select>
</td>
</tr>
{{/slots}}
{{/sections}}
</tbody>
</table>
{{/hasslots}}
<div>
{{#hasgradeitems}}
<h3>{{#str}} gradeitemsremovealltitle, quiz {{/str}}</h3>
<button type="button" class="btn btn-danger" id="mod_quiz-grades_reset_all"
data-quiz-id="{{quizid}}">{{#str}} gradeitemsremoveall, quiz {{/str}}</button>
{{/hasgradeitems}}
</div>
</div>
@@ -0,0 +1,59 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/edit_nav_actions
Actions bar at the top of the various quiz edit pages.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* overridesnav - must alwasy be present.
* addoverridebutton - should only be present if the user has permission to add a new override.
Example context (json):
{
"id": "url_select_test",
"action": "https://example.com/post",
"formid": "url_select_form",
"sesskey": "sesskey",
"navmenu": {
"options": [{
"name": "Questions",
"value": "/mod/quiz/edit.php?cmid=123"
},
{
"name": "Complex grading",
"value": "/mod/quiz/editgrading.php?cmid=123"
}
]
}
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
{{#navmenu}}
<div class="navitem">
{{>core/url_select}}
</div>
{{/navmenu}}
</div>
</div>
@@ -0,0 +1,69 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/list_of_attempts
This template renders summary information about a list of quiz attempts.
The structure for each attempt should be what is required by mod_quiz/attempt_summary_information.
Example context (json):
{
"hasattempts": true,
"attempts": [
{
"name": "Attempt 1",
"reviewlink": "<a href='https://qa.moodledemo.net/mod/quiz/review.php?attempt=13&cmid=30'>Review</a>",
"summarydata": {
"hasitems": true,
"items": [
{
"title": "<img src='https://qa.moodledemo.net/pluginfile.php/27/user/icon/boost/f2?rev=5522' class='userpicture' width='35' height='35' alt='It is me!'>",
"content": "<a href='https://qa.moodledemo.net/user/view.php?id=4&amp;course=2'>Sam Student</a>"
},
{"title": "Status", "content": "Finished"},
{"title": "Started", "content": "Thursday, 23 November 2023, 9:29 AM"},
{"title": "Completed", "content": "Thursday, 23 November 2023, 9:32 AM"},
{"title": "Duration", "content": "3 minutes"},
{"title": "Grade", "content": "Not yet graded"}
]
}
}
]
}
}}
{{#hasattempts}}
<h3>{{# str}}summaryofattempts, quiz{{/str}}</h3>
<ul class="list-unstyled row row-cols-1 row-cols-md-2 no-gutters">
{{#attempts}}
<li class="col pl-0 pr-2 mb-2">
<div class="card h-100">
<div class="card-header py-2 border-bottom-0">
<h4 class="card-title my-0">{{name}}</h4>
</div>
{{#summarydata}}
{{> mod_quiz/attempt_summary_information}}
{{/summarydata}}
<div class="card-body py-2">
<div>{{{reviewlink}}}</div>
</div>
</div>
</li>
{{/attempts}}
</ul>
{{/hasattempts}}
@@ -0,0 +1,79 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/modal_add_random_question
Modal for adding a random question to a quiz activity.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* title A cleaned string (use clean_text()) to display.
* body HTML content for the boday
Example context (json):
{
"title": "Example modal",
"body": "Some example content for the body"
}
}}
{{< core/modal }}
{{$body}}
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active"
data-toggle="tab"
href="#existing-category-{{uniqid}}"
role="tab">
{{#str}} existingcategory, mod_quiz {{/str}}
</a>
</li>
{{#hidden}}
<li class="nav-item">
<a class="nav-link"
data-toggle="tab"
href="#new-category-{{uniqid}}"
role="tab">
{{#str}} newcategory, mod_quiz {{/str}}
</a>
</li>
{{/hidden}}
</ul>
<div class="tab-content" data-region="tab-content">
<div class="text-sm-center pt-5" data-region="loading-container">
{{> core/loading }}
</div>
<div class="tab-pane active pt-3"
id="existing-category-{{uniqid}}"
role="tabpanel"
data-region="existing-category-container">
</div>
{{#hidden}}
<div class="tab-pane pt-3"
id="new-category-{{uniqid}}"
role="tabpanel"
data-region="new-category-container">
</div>
{{/hidden}}
</div>
{{/body}}
{{/ core/modal }}
@@ -0,0 +1,85 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/overrides_actions
Actions bar at the top of the overrides page UI.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* overridesnav - must alwasy be present.
* addoverridebutton - should only be present if the user has permission to add a new override.
Example context (json):
{
"overridesnav": {
"id": "url_select_test",
"action": "https://example.com/post",
"formid": "url_select_form",
"sesskey": "sesskey",
"label": "core/url_select",
"options": [{
"name": "User overrides",
"value": "/mod/quiz/overrides.php?cmid=71&mode=user"
},
{
"name": "Group overrides",
"value": "/mod/quiz/overrides.php?cmid=71&mode=group"
}
],
"disabled": false,
"title": "Some cool title"
},
"addoverridebutton": {
"id": "single_button1234",
"type": "primary",
"method": "get",
"url": "http://localhost/moodle/mod/quiz/overrideedit.php",
"label": "Add user override",
"classes": "singlebutton",
"disabled": false,
"params": [
{
"name": "cmid",
"value": "73"
},
{
"name": "action",
"value": "adduser"
}
]
}
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
{{#overridesnav}}
<div class="navitem">
{{>core/url_select}}
</div>
{{/overridesnav}}
{{#addoverridebutton}}
<div class="navitem">
{{>core/single_button}}
</div>
{{/addoverridebutton}}
</div>
</div>
@@ -0,0 +1,29 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Question chooser.
}}
{{> core/chooser }}
{{#js}}
require([
'core/yui'
], function(Y) {
Y.use('moodle-mod_quiz-questionchooser', function() {
M.mod_quiz.init_questionchooser();
});
});
{{/js}}
+55
View File
@@ -0,0 +1,55 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/question_slot
This template renders the question slot content.
Example context (json):
{
"checkbox" : "<input id='selectquestion-1' name='selectquestion[]' type='checkbox' class='select-multiple-checkbox'>",
"questionnumber" : "<span class='slotnumber'><span class='accesshide'>Question</span> 1</span>",
"questionname" : "This is a test question",
"questionicons" : "<i class='icon fa fa-search-plus fa-fw' title='Preview question' aria-label='Preview question'></i>",
"canbeedited" : false,
"questiondependencyicon" : "<span class='question_dependency_wrapper question_dependency_cannot_depend'></span>"
}
}}
<div class="mod-indent-outer" id="mod-indent-outer-slot-{{slotid}}">
{{{checkbox}}}
{{{questionnumber}}}
<div class="mod-indent"></div>
<div class="activityinstance">
{{{questionname}}}
</div>
<span class="actions">
{{#versionselection}}
<label for="version-{{slotid}}" class="sr-only">{{#str}}question_version, question{{/str}}</label>
<select id="version-{{slotid}}" name="version" class="form-control mr-2 h-auto version-selection"
data-action="mod_quiz-select_slot" data-slot-id="{{slotid}}">
{{#versionoption}}
<option value="{{version}}" {{#selected}}selected="selected"{{/selected}}>{{versionvalue}}</option>
{{/versionoption}}
</select>
{{/versionselection}}
{{{questionicons}}}
</span>
{{#canbeedited}}
{{{questiondependencyicon}}}
{{/canbeedited}}
</div>
{{#draftversion}}
<div class="alert alert-danger" role="alert">{{#str}}questiondraftwillnotwork, mod_quiz{{/str}}</div>
{{/draftversion}}
@@ -0,0 +1,28 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/random_question_container
Container for list of filtered questions.
Example context (json):
{
}
}}
<div class="categoryquestionscontainer" id="questionscontainer">
</div>
@@ -0,0 +1,58 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/random_question_form_preview_question_list
A preview section for the list of questions that match the random
question criteria in the random question form.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* title A cleaned string (use clean_text()) to display.
* body HTML content for the boday
Example context (json):
{
"questions": [
{
"name":"Example question 1"
},
{
"name":"Example question 2"
},
{
"name":"Example question 3"
},
{
"name":"Example question 4"
}
]
}
}}
<ul class="list-group" data-region="question-list">
{{#questions}}
<li class="list-group-item text-truncate">
{{#icon}}{{#pix}} {{key}}, {{component}}, {{{alttext}}} {{/pix}}{{/icon}}
{{{name}}}
</li>
{{/questions}}
</ul>
@@ -0,0 +1,37 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/submission_confirmation
Submission confirmation dialogue template
Example context (json):
{
"hasunanswered": false,
"totalunanswered": 0
}
}}
<div class="quiz-submission-confirmation-content">
<div class="mb-3">
{{#str}} confirmclose, mod_quiz {{/str}}
</div>
{{#hasunanswered}}
<div class="alert alert-warning">
{{#str}} submission_confirmation_unanswered, mod_quiz, {{totalunanswered}} {{/str}}
</div>
{{/hasunanswered}}
</div>
+34
View File
@@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/timer
Login page template
Example context (json):
{
}
}}
<div id="quiz-timer-wrapper" class="mb-2">
<div id="quiz-timer" class="quiz-timer-inner py-1 px-2 ml-auto" role="timer" aria-atomic="true" aria-relevant="text">
{{#str}} timeleft, quiz {{/str}}
<span id="quiz-time-left"></span>
</div>
<button type="button" class="btn btn-secondary btn-small ml-1" id="toggle-timer" aria-controls="quiz-timer" aria-describedby="quiz-timer">
{{#str}} hide, core {{/str}}
</button>
</div>
@@ -0,0 +1,43 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_quiz/update_filter_condition_form
From to add random questions.
Example context (json):
{
"questionbank": "<pre>Question bank HTML goes here</pre>",
"returnurl": "https://example.com",
"cmid": "1234",
"slotid": "5678"
}
}}
<div>
<!-- Question bank -->
<div id="questionbank_container">
{{{questionbank}}}
</div>
<!-- submit buttons -->
<form action="{{returnurl}}" method="POST" id="update_filter_condition_form" data-cmid="{{cmid}}" data-slotid="{{slotid}}">
<input type="hidden" name="message" value="">
<input type="submit" class="btn btn-primary" name="update" value="{{#str}} updatefilterconditon, mod_quiz {{/str}}">
<input type="submit" class="btn btn-secondary" name="cancel" value="{{#str}} cancel {{/str}}">
</form>
</div>