AutorÃa | Ultima modificación | Ver Log |
{{!
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_questionnaire/mobile_view_activity_page
Template which defines a questionnaire display in the mobile app.
Context variables required for this template:
* questionnaire - object: "intro" and "autonumquestions" strings for first respondent link.
* previous - object: "url" and "title" strings for previous link.
* respnumber - object: Current positio ("currpos") and "total" number of responses.
* next - object: "url" and "title" strings for next link.
* lastrespondent - object: "url" and "title" strings for last respondent link.
* listlink - string: Url of the link back to the response list.
* printaction - string: HTML to launch the print function.
Example context (json):
{
"cmid": 985,
"userid": 267,
"intro": "Welcome to the questionnaire",
"autonumquestions": "1",
"id": "342",
"rid": 0,
"surveyid": "23",
"action": "nextpage",
"pagenum": 0,
"nextpage": 1,
"prevpage": 0,
"completed": "1",
"complete_userdate": "Monday, 17 December 2018, 3:34pm",
"emptypage": "0",
"emptypage_content": "This is an empty page.",
"pagequestions": [
{
"id": 5432,
"type_id": 4,
"qnum": "Q1",
"content": "Answer this question",
"required": "1",
"fieldkey": "response_1_23",
"isselect": "0",
"isbool": "0",
"isradiobutton": "1",
"ischeckbox": "0",
"istextessay": "0",
"israte": "0",
"choices": [
{
"id": 745,
"content": "Red",
"value": " ",
"choice_id": 745,
"min": 0,
"max": 5,
"minstr": "Low",
"maxstr": "High",
"na": 0
}
]
}
]
}
}}
{{=<% %>=}}
<div>
<core-course-module-description description="<%intro%>"
component="mod_questionnaire" componentId="<%cmid%>"
pagenum="<%pagenum%>"></core-course-module-description>
<%#notifications%>
<ion-card>
<ion-card-content>
<%{notifications}%>
</ion-card-content>
</ion-card>
<%/notifications%>
<div>
<ion-card>
<ion-list>
<%#pagequestions%>
<ion-list-header text-wrap>
<%#autonumquestions%><ion-badge color="dark" item-start><%qnum%></ion-badge><%/autonumquestions%>
<core-format-text text="<%content%>"></core-format-text>
<%#required%><ion-badge item-end color="danger">{{ 'plugin.mod_questionnaire.required' | translate }}</ion-badge><%/required%>
</ion-list-header>
<%#isselect%>
<%> mod_questionnaire/local/mobile/ionic3/select_question %>
<%/isselect%>
<%#isbool%>
<%> mod_questionnaire/local/mobile/ionic3/boolean_question %>
<%/isbool%>
<%#isradiobutton%>
<%> mod_questionnaire/local/mobile/ionic3/radio_question %>
<%/isradiobutton%>
<%#ischeckbox%>
<%> mod_questionnaire/local/mobile/ionic3/checkbox_question %>
<%/ischeckbox%>
<%#istextessay%>
<%> mod_questionnaire/local/mobile/ionic3/text_question %>
<%/istextessay%>
<%#isnumeric%>
<%> mod_questionnaire/local/mobile/ionic3/numeric_question %>
<%/isnumeric%>
<%#isdate%>
<%> mod_questionnaire/local/mobile/ionic3/date_question %>
<%/isdate%>
<%#israte%>
<%> mod_questionnaire/local/mobile/ionic3/rate_question %>
<%/israte%>
<%#isslider%>
<%> mod_questionnaire/local/mobile/ionic3/slider_question %>
<%/isslider%>
<%/pagequestions%>
<%^pagequestions%>
<p>No questions found.</p>
<%/pagequestions%>
<%#prevpage%>
<button ion-button item-end outline icon-start block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
[args]="{
cmid: <%cmid%>,
rid: <%rid%>,
completeq: 1,
action: 'previouspage',
pagenum: <%pagenum%>
}"
[useOtherData]="null"
[preSets]="{getFromCache: 0, saveToCache: 0}"
refreshOnSuccess="true"
samePage="true" type="submit"
><ion-icon name="arrow-back"></ion-icon> {{ 'plugin.mod_questionnaire.previouspage' | translate }}</button>
<%/prevpage%>
<%#nextpage%>
<button ion-button item-end outline icon-end block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
[args]="{
cmid: <%cmid%>,
rid: <%rid%>,
completeq: 1,
action: 'nextpage',
pagenum: <%pagenum%>
}"
[useOtherData]="null"
[preSets]="{getFromCache: 0, saveToCache: 0}"
refreshOnSuccess="true"
samePage="true" type="submit"
>{{ 'plugin.mod_questionnaire.nextpage' | translate }} <ion-icon name="arrow-forward"></ion-icon></button>
<%/nextpage%>
<%^nextpage%><%^completed%>
<button ion-button block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
[args]="{
questionnaireid: <%id%>,
surveyid: <%surveyid%>,
userid: <%userid%>,
cmid: <%cmid%>,
pagenum: <%pagenum%>,
completed: <%completed%>,
rid: <%rid%>,
submit: 1,
action: 'submit'
}"
[useOtherData]="null"
[preSets]="{getFromCache: 0, saveToCache: 0}"
refreshOnSuccess="true"
samePage="true" type="submit"
>{{ 'plugin.mod_questionnaire.savechanges' | translate }}</button>
<%/completed%><%/nextpage%>
</ion-list>
</ion-card>
</div>
<%#emptypage%>
<%/emptypage%>
</div>