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_date
|
|
|
19 |
|
|
|
20 |
Template which defines a results display for responses with dates. This template uses a simple level of HTML,
|
|
|
21 |
suitable for being translated into a PDF file by the TCPDF library.
|
|
|
22 |
|
|
|
23 |
Classes required for JS:
|
|
|
24 |
* /mod/questionnaire/module.js
|
|
|
25 |
|
|
|
26 |
Data attributes required for JS:
|
|
|
27 |
* none
|
|
|
28 |
|
|
|
29 |
Context variables required for this template:
|
|
|
30 |
|
|
|
31 |
Example context (json):
|
|
|
32 |
{
|
|
|
33 |
"responses": [
|
|
|
34 |
{
|
|
|
35 |
"response": {
|
|
|
36 |
"text": "04/12/2016",
|
|
|
37 |
"total": 2
|
|
|
38 |
}
|
|
|
39 |
},
|
|
|
40 |
{
|
|
|
41 |
"response": {
|
|
|
42 |
"text": "06/01/2012",
|
|
|
43 |
"total": 2
|
|
|
44 |
}
|
|
|
45 |
}
|
|
|
46 |
],
|
|
|
47 |
"total": {
|
|
|
48 |
"total": "8/10"
|
|
|
49 |
}
|
|
|
50 |
}
|
|
|
51 |
}}
|
|
|
52 |
<!-- Begin HTML generated from results_date template. -->
|
|
|
53 |
{{#responses.0}}
|
|
|
54 |
<table class="generaltable">
|
|
|
55 |
<thead>
|
|
|
56 |
<tr>
|
|
|
57 |
<th class="header c0" style="text-align:left;" scope="col">{{#str}} num, mod_questionnaire {{/str}}</th>
|
|
|
58 |
<th class="header c1 lastcol" style="text-align:right;" scope="col">{{#str}} response, mod_questionnaire {{/str}}</th>
|
|
|
59 |
</tr>
|
|
|
60 |
</thead>
|
|
|
61 |
<tbody>
|
|
|
62 |
{{/responses.0}}
|
|
|
63 |
{{#responses}}
|
|
|
64 |
{{#response}}
|
|
|
65 |
<tr class=""{{^response.evencolor}} style="background-color: #E5E5E6"{{/response.evencolor}}>
|
|
|
66 |
<td class="cell c0" style="text-align:left;">{{response.total}}</td>
|
|
|
67 |
<td class="cell c1 lastcol" style="text-align:right;">{{response.text}}</td>
|
|
|
68 |
</tr>
|
|
|
69 |
{{/response}}
|
|
|
70 |
{{/responses}}
|
|
|
71 |
{{#total}}
|
|
|
72 |
<tr{{#total.evencolor}} style="background-color: #E5E5E6"{{/total.evencolor}}>
|
|
|
73 |
<td colspan="2"><div class="tabledivider"> </div></td>
|
|
|
74 |
</tr>
|
|
|
75 |
<tr class="lastrow"{{^total.evencolor}} style="background-color: #E5E5E6"{{/total.evencolor}}>
|
|
|
76 |
<td class="cell c0" style="text-align:left;">{{#str}} totalresponses, mod_questionnaire{{/str}}</td>
|
|
|
77 |
<td class="cell c1 lastcol" style="text-align:right;">{{total}}</td>
|
|
|
78 |
</tr>
|
|
|
79 |
{{/total}}
|
|
|
80 |
{{#responses.0}}
|
|
|
81 |
</tbody>
|
|
|
82 |
</table>
|
|
|
83 |
{{/responses.0}}
|
|
|
84 |
{{^responses}}
|
|
|
85 |
<p class="generaltable"> {{#str}} noresponsedata, questionnaire{{/str}}</p>
|
|
|
86 |
{{/responses}}
|
|
|
87 |
<!-- End HTML generated from results_choice template. -->
|