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/results_choice
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": "28",
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": "28",
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": "28",
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
{{#responses.0}}
77
<table class="generaltable">
78
    <thead>
79
    <tr>
80
        <th class="header c0" style="text-align:left;width:50%;" scope="col">{{#str}} response, mod_questionnaire {{/str}}</th>
81
        <th class="header c1" style="text-align:left;width:40%;" scope="col">{{#str}} average, mod_questionnaire {{/str}}</th>
82
        <th class="header c2 lastcol" style="text-align:right;width:10%;" scope="col">{{#str}} total, mod_questionnaire {{/str}}</th>
83
    </tr>
84
    </thead>
85
    <tbody>
86
{{/responses.0}}
87
{{#responses}}
88
    {{#response}}
89
    <tr class="">
90
        <td class="cell c0" style="text-align:left;width:50%;">{{{response.text}}}</td>
91
        <td class="cell c1" style="text-align:left;width:40%;white-space:nowrap;">
92
            <img style="height:9px; width:4px;" alt="{{response.alt1}}" src="{{response.image1}}" /><img style="height:9px; width:{{response.width2}}px;" alt="{{response.alt2}}" src="{{response.image2}}" /><img style="height:9px; width:4px;" alt="{{response.alt3}}" src="{{response.image3}}" />
93
            {{{response.percent}}}
94
        </td>
95
        <td class="cell c2 lastcol" style="text-align:right;width:10%;">{{response.total}}</td>
96
    </tr>
97
    {{/response}}
98
{{/responses}}
99
{{#total}}
100
    <tr>
101
        <td colspan="3"><div class="tabledivider"></div></td>
102
    </tr>
103
    <tr class="lastrow">
104
        <td class="cell c0" style="text-align:left;width:50%;">{{#str}} totalresponses, mod_questionnaire{{/str}}</td>
105
        <td class="cell c1" style="text-align:left;width:40%;white-space:nowrap;">
106
            <img style="height:9px; width:4px;" alt="{{alt1}}" src="{{image1}}" /><img style="height:9px; width:{{width2}}px;" alt="{{alt2}}" src="{{image2}}" /><img style="height:9px; width:4px;" alt="{{alt3}}" src="{{image3}}" />
107
            {{{percent}}}
108
        </td>
109
        <td class="cell c2 lastcol" style="text-align:right;width:10%;">{{total}}</td>
110
    </tr>
111
{{/total}}
112
{{#responses.0}}
113
    </tbody>
114
</table>
115
{{/responses.0}}
116
{{^responses}}
117
    <p class="generaltable">&nbsp;{{#str}} noresponsedata, questionnaire{{/str}}</p>
118
{{/responses}}
119
<!-- End HTML generated from results_choice template. -->