Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
4
    Moodle is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    Moodle is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
 
14
    You should have received a copy of the GNU General Public License
15
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template mod_questionnaire/mobile_view_activity_page
19
 
20
    Template which defines a questionnaire display in the mobile app.
21
 
22
    Context variables required for this template:
23
    * questionnaire - object: "intro" and "autonumquestions" strings for first respondent link.
24
    * previous - object: "url" and "title" strings for previous link.
25
    * respnumber - object: Current positio ("currpos") and "total" number of responses.
26
    * next - object: "url" and "title" strings for next link.
27
    * lastrespondent - object: "url" and "title" strings for last respondent link.
28
    * listlink - string: Url of the link back to the response list.
29
    * printaction - string: HTML to launch the print function.
30
 
31
    Example context (json):
32
    {
33
        "cmid": 985,
34
        "userid": 267,
35
        "intro": "Welcome to the questionnaire",
36
        "autonumquestions": "1",
37
        "id": "342",
38
        "rid": 0,
39
        "surveyid": "23",
40
        "action": "nextpage",
41
        "pagenum": 0,
42
        "nextpage": 1,
43
        "prevpage": 0,
44
        "completed": "1",
45
        "complete_userdate": "Monday, 17 December 2018, 3:34pm",
46
        "emptypage": "0",
47
        "emptypage_content": "This is an empty page.",
48
        "pagequestions": [
49
            {
50
                "id": 5432,
51
                "type_id": 4,
52
                "qnum": "Q1",
53
                "content": "Answer this question",
54
                "required": "1",
55
                "fieldkey": "response_1_23",
56
                "isselect": "0",
57
                "isbool": "0",
58
                "isradiobutton": "1",
59
                "ischeckbox": "0",
60
                "istextessay": "0",
61
                "israte": "0",
62
                "choices": [
63
                    {
64
                        "id": 745,
65
                        "content": "Red",
66
                        "value": " ",
67
                        "choice_id": 745,
68
                        "min": 0,
69
                        "max": 5,
70
                        "minstr": "Low",
71
                        "maxstr": "High",
72
                        "na": 0
73
                    }
74
                ]
75
            }
76
        ]
77
    }
78
}}
79
{{=<% %>=}}
80
<div>
81
    <core-course-module-description description="<%intro%>"
82
                                    component="mod_questionnaire" componentId="<%cmid%>"
83
                                    pagenum="<%pagenum%>"></core-course-module-description>
84
    <%#notifications%>
85
    <ion-card>
86
        <ion-card-content>
87
            <%{notifications}%>
88
        </ion-card-content>
89
    </ion-card>
90
    <%/notifications%>
91
    <div>
92
        <ion-card>
93
            <ion-list>
94
                <%#pagequestions%>
95
                <ion-list-header text-wrap>
96
                    <%#autonumquestions%><ion-badge color="dark" item-start><%qnum%></ion-badge><%/autonumquestions%>
97
                    <core-format-text text="<%content%>"></core-format-text>
98
                    <%#required%><ion-badge item-end color="danger">{{ 'plugin.mod_questionnaire.required' | translate }}</ion-badge><%/required%>
99
                </ion-list-header>
100
                <%#isselect%>
101
                    <%> mod_questionnaire/local/mobile/ionic3/select_question %>
102
                <%/isselect%>
103
                <%#isbool%>
104
                    <%> mod_questionnaire/local/mobile/ionic3/boolean_question %>
105
                <%/isbool%>
106
                <%#isradiobutton%>
107
                    <%> mod_questionnaire/local/mobile/ionic3/radio_question %>
108
                <%/isradiobutton%>
109
                <%#ischeckbox%>
110
                    <%> mod_questionnaire/local/mobile/ionic3/checkbox_question %>
111
                <%/ischeckbox%>
112
                <%#istextessay%>
113
                    <%> mod_questionnaire/local/mobile/ionic3/text_question %>
114
                <%/istextessay%>
115
                <%#isnumeric%>
116
                    <%> mod_questionnaire/local/mobile/ionic3/numeric_question %>
117
                <%/isnumeric%>
118
                <%#isdate%>
119
                    <%> mod_questionnaire/local/mobile/ionic3/date_question %>
120
                <%/isdate%>
121
                <%#israte%>
122
                    <%> mod_questionnaire/local/mobile/ionic3/rate_question %>
123
                <%/israte%>
124
                <%#isslider%>
125
                    <%> mod_questionnaire/local/mobile/ionic3/slider_question %>
126
                <%/isslider%>
127
                <%/pagequestions%>
128
 
129
                <%^pagequestions%>
130
                <p>No questions found.</p>
131
                <%/pagequestions%>
132
 
133
                <%#prevpage%>
134
                <button ion-button item-end outline icon-start block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
135
                        [args]="{
136
                                        cmid: <%cmid%>,
137
                                        rid: <%rid%>,
138
                                        completeq: 1,
139
                                        action: 'previouspage',
140
                                        pagenum: <%pagenum%>
141
                                    }"
142
                        [useOtherData]="null"
143
                        [preSets]="{getFromCache: 0, saveToCache: 0}"
144
                        refreshOnSuccess="true"
145
                        samePage="true" type="submit"
146
                ><ion-icon name="arrow-back"></ion-icon> {{ 'plugin.mod_questionnaire.previouspage' | translate }}</button>
147
                <%/prevpage%>
148
 
149
                <%#nextpage%>
150
                <button ion-button item-end outline icon-end block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
151
                        [args]="{
152
                                    cmid: <%cmid%>,
153
                                    rid: <%rid%>,
154
                                    completeq: 1,
155
                                    action: 'nextpage',
156
                                    pagenum: <%pagenum%>
157
                                }"
158
                        [useOtherData]="null"
159
                        [preSets]="{getFromCache: 0, saveToCache: 0}"
160
                        refreshOnSuccess="true"
161
                        samePage="true" type="submit"
162
                >{{ 'plugin.mod_questionnaire.nextpage' | translate }} <ion-icon name="arrow-forward"></ion-icon></button>
163
                <%/nextpage%>
164
 
165
                <%^nextpage%><%^completed%>
166
                <button ion-button block core-site-plugins-new-content component="mod_questionnaire" method="mobile_view_activity"
167
                        [args]="{
168
                                    questionnaireid: <%id%>,
169
                                    surveyid: <%surveyid%>,
170
                                    userid: <%userid%>,
171
                                    cmid: <%cmid%>,
172
                                    pagenum: <%pagenum%>,
173
                                    completed: <%completed%>,
174
                                    rid: <%rid%>,
175
                                    submit: 1,
176
                                    action: 'submit'
177
                                }"
178
                        [useOtherData]="null"
179
                        [preSets]="{getFromCache: 0, saveToCache: 0}"
180
                        refreshOnSuccess="true"
181
                        samePage="true" type="submit"
182
                >{{ 'plugin.mod_questionnaire.savechanges' | translate }}</button>
183
                <%/completed%><%/nextpage%>
184
            </ion-list>
185
        </ion-card>
186
    </div>
187
    <%#emptypage%>
188
    <%/emptypage%>
189
</div>