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/results_rate
|
|
|
19 |
|
|
|
20 |
Template which defines a results display for responses with defined choices.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* /mod/questionnaire/module.js
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
|
|
|
30 |
Example context (json):
|
|
|
31 |
{
|
|
|
32 |
"responses": [
|
|
|
33 |
{
|
|
|
34 |
"response": {
|
|
|
35 |
"text": "choice 1",
|
|
|
36 |
"alt1": "alt1",
|
|
|
37 |
"image1": "http://localhost/mod/questionnaire/images/hbar_1.gif",
|
|
|
38 |
"alt2": "alt2",
|
|
|
39 |
"width2": "28px",
|
|
|
40 |
"image2": "http://localhost/mod/questionnaire/images/hbar.gif",
|
|
|
41 |
"alt3": "alt3",
|
|
|
42 |
"image3": "http://localhost/mod/questionnaire/images/hbar_r.gif",
|
|
|
43 |
"percent": "20%",
|
|
|
44 |
"total": 2
|
|
|
45 |
}
|
|
|
46 |
},
|
|
|
47 |
{
|
|
|
48 |
"response": {
|
|
|
49 |
"text": "choice 2",
|
|
|
50 |
"alt1": "alt1",
|
|
|
51 |
"image1": "http://localhost/mod/questionnaire/images/hbar_1.gif",
|
|
|
52 |
"alt2": "alt2",
|
|
|
53 |
"width2": "28px",
|
|
|
54 |
"image2": "http://localhost/mod/questionnaire/images/hbar.gif",
|
|
|
55 |
"alt3": "alt3",
|
|
|
56 |
"image3": "http://localhost/mod/questionnaire/images/hbar_r.gif",
|
|
|
57 |
"percent": "20%",
|
|
|
58 |
"total": 2
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
],
|
|
|
62 |
"total": {
|
|
|
63 |
"alt1": "alt1",
|
|
|
64 |
"image1": "http://localhost/mod/questionnaire/images/hbar_1.gif",
|
|
|
65 |
"alt2": "alt2",
|
|
|
66 |
"width2": "28px",
|
|
|
67 |
"image2": "http://localhost/mod/questionnaire/images/hbar.gif",
|
|
|
68 |
"alt3": "alt3",
|
|
|
69 |
"image3": "http://localhost/mod/questionnaire/images/hbar_r.gif",
|
|
|
70 |
"percent": "20%",
|
|
|
71 |
"total": "8/10"
|
|
|
72 |
}
|
|
|
73 |
}
|
|
|
74 |
}}
|
|
|
75 |
<!-- Begin HTML generated from results_choice template. -->
|
|
|
76 |
{{#averages}}
|
|
|
77 |
<table class="generaltable">
|
|
|
78 |
<thead>
|
|
|
79 |
<tr>
|
|
|
80 |
{{#headers}}
|
|
|
81 |
<th class="header" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</th>
|
|
|
82 |
{{/headers}}
|
|
|
83 |
</tr>
|
|
|
84 |
</thead>
|
|
|
85 |
<tbody>
|
|
|
86 |
|
|
|
87 |
{{#choicelabelrow}}
|
|
|
88 |
<tr class="">
|
|
|
89 |
{{#column1}}
|
|
|
90 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
91 |
{{/column1}}
|
|
|
92 |
{{#column2}}
|
|
|
93 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">
|
|
|
94 |
<table width="100%" cellpadding="2" cellspacing="0" border="1">
|
|
|
95 |
<tbody>
|
|
|
96 |
<tr>
|
|
|
97 |
{{#ranks}}
|
|
|
98 |
<td class="smalltext" style="text-align:center;" width="{{width}}">{{{text}}}</td>
|
|
|
99 |
{{/ranks}}
|
|
|
100 |
</tr>
|
|
|
101 |
</tbody>
|
|
|
102 |
</table>
|
|
|
103 |
</td>
|
|
|
104 |
{{/column2}}
|
|
|
105 |
{{#column3}}
|
|
|
106 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
107 |
{{/column3}}
|
|
|
108 |
{{#column4}}
|
|
|
109 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
110 |
{{/column4}}
|
|
|
111 |
</tr>
|
|
|
112 |
{{/choicelabelrow}}
|
|
|
113 |
|
|
|
114 |
{{#choiceaverages}}
|
|
|
115 |
<tr class="">
|
|
|
116 |
{{#column1}}
|
|
|
117 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
118 |
{{/column1}}
|
|
|
119 |
{{#column2}}
|
|
|
120 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">
|
|
|
121 |
{{#spacerimage}}<img style="height:12px; width: {{marginpdf}}in;" alt="" src="{{spacerimage}}" />{{/spacerimage}}{{#imageurl}}<img style="height:12px; width: 6px;" alt="" src="{{imageurl}}" />{{/imageurl}}
|
|
|
122 |
</td>
|
|
|
123 |
{{/column2}}
|
|
|
124 |
{{#column3}}
|
|
|
125 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
126 |
{{/column3}}
|
|
|
127 |
{{#column4}}
|
|
|
128 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{{text}}}</td>
|
|
|
129 |
{{/column4}}
|
|
|
130 |
</tr>
|
|
|
131 |
{{/choiceaverages}}
|
|
|
132 |
{{#nodata.0}}
|
|
|
133 |
<tr class="">
|
|
|
134 |
{{#nodata}}
|
|
|
135 |
<td class="cell" style="text-align:{{align}};" width="{{width}}" scope="col">{{text}}</td>
|
|
|
136 |
{{/nodata}}
|
|
|
137 |
</tr>
|
|
|
138 |
{{/nodata.0}}
|
|
|
139 |
</tbody>
|
|
|
140 |
</table>
|
|
|
141 |
{{/averages}}
|
|
|
142 |
{{#totals}}
|
|
|
143 |
<table class="generaltable">
|
|
|
144 |
<thead>
|
|
|
145 |
<tr>
|
|
|
146 |
{{#headers}}
|
|
|
147 |
<th class="header" style="text-align:{{align}};" scope="col">{{{text}}}</th>
|
|
|
148 |
{{/headers}}
|
|
|
149 |
</tr>
|
|
|
150 |
</thead>
|
|
|
151 |
<tbody>
|
|
|
152 |
{{#choices}}
|
|
|
153 |
<tr>
|
|
|
154 |
{{#totalcols}}
|
|
|
155 |
<td class="cell" style="text-align:{{align}};">{{{text}}}</td>
|
|
|
156 |
{{/totalcols}}
|
|
|
157 |
</tr>
|
|
|
158 |
{{/choices}}
|
|
|
159 |
</tbody>
|
|
|
160 |
</table>
|
|
|
161 |
{{/totals}}
|
|
|
162 |
{{#noresponses}}
|
|
|
163 |
<p class="generaltable">{{# str }}noresponsedata, mod_questionnaire{{/ str }}</p>
|
|
|
164 |
{{/noresponses}}
|
|
|
165 |
<!-- End HTML generated from results_choice template. -->
|