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_rate_question
19
 
20
    Template which defines a rate question display in the mobile app.
21
 
22
    Context variables required for this template:
23
    * fieldkey - integer: ID of the question.
24
    * choices - array of objects: choice_id, content, completed and value of each question choice.
25
 
26
    Example context (json):
27
    {
28
        "choices": [
29
            {
30
                "fieldkey": 985,
31
                "content": "Red",
32
                "min": 0,
33
                "max": 5,
34
                "minstr": "zero",
35
                "maxstr": "five",
36
                "na": 1
37
            },
38
            {
39
                "fieldkey": 986,
40
                "content": "Blue",
41
                "min": 0,
42
                "max": 5,
43
                "minstr": "zero",
44
                "maxstr": "five",
45
                "na": 1
46
            }
47
        ],
48
        "rates": [
49
            {
50
                "value": 0,
51
                "label": "Good"
52
            },
53
            {
54
                "value": 1,
55
                "label": 1
56
            }
57
        ]
58
    }
59
}}
60
{{=<% %>=}}
61
<ion-list>
62
    <ion-grid>
63
        <ion-row justify-content-center align-items-center text-center>
64
            <%#choices.0%>
65
            <%#leftlabel%>
66
            <ion-col></ion-col>
67
            <%/leftlabel%>
68
            <%/choices.0%>
69
            <%#rates%>
70
            <ion-col>
71
                <ion-label><%label%></ion-label>
72
            </ion-col>
73
            <%/rates%>
74
            <%#hasnacolumn%>
75
            <ion-col>
76
                <ion-label><%label%></ion-label>
77
            </ion-col>
78
            <%/hasnacolumn%>
79
            <%#choices.0%>
80
            <%#rightlabel%>
81
            <ion-col></ion-col>
82
            <%/rightlabel%>
83
            <%/choices.0%>
84
        </ion-row>
85
        <%#choices%>
86
        <ion-row><ion-col>
87
            <ion-list-header style="margin-bottom: 0; border-top-style: none;">
88
                <core-format-text text="<%content%>"></core-format-text>
89
                <ion-badge item-end>{{ CONTENT_OTHERDATA.<%fieldkey%> }}</ion-badge>
90
            </ion-list-header>
91
        </ion-col></ion-row>
92
        <ion-row radio-group [(ngModel)]="CONTENT_OTHERDATA.<%fieldkey%>" justify-content-center align-items-center text-center>
93
            <%#leftlabel%>
94
            <ion-col>
95
                <%leftlabel%>
96
            </ion-col>
97
            <%/leftlabel%>
98
            <%#rates%>
99
            <ion-col>
100
                <ion-radio value="<%label%>" <%#completed%> disabled="true"<%/completed%>></ion-radio>
101
            </ion-col>
102
            <%/rates%>
103
            <%#hasnacolumn%>
104
            <ion-col>
105
                <ion-radio value="<%value%>" <%#completed%> disabled="true"<%/completed%>></ion-radio>
106
            </ion-col>
107
            <%/hasnacolumn%>
108
            <%#rightlabel%>
109
            <ion-col>
110
                <%rightlabel%>
111
            </ion-col>
112
            <%/rightlabel%>
113
        </ion-row>
114
        <%/choices%>
115
    </ion-grid>
116
</ion-list>