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/response_rate
19
 
20
    Template which defines a rate type response survey display.
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
        "twidth": "50%",
33
        "osgood": "1",
34
        "sidecolwidth": "45%",
35
        "colwidth": "10%",
36
        "textalign": "right",
37
        "headers": [
38
            {
39
                "bg": "c0",
40
                "str": "Okay"
41
            }
42
        ],
43
        "rows": [
44
            {
45
                "content": "HTML content",
46
                "cols": [
47
                    {
48
                        "checked": "1",
49
                        "bg": "c0",
50
                        "str": "Okay",
51
                        "name": "choice1"
52
                    }
53
                ],
54
                "osgoodstr": "Something right."
55
            }
56
        ]
57
    }
58
}}
59
<!-- Begin HTML generated from response_rate template. -->
60
<div class="questionnaire_response questionnaire_radio">
61
<table class="individual" style="border: 0; border-spacing: 1px; padding: 0; width:{{twidth}}">
62
  <tbody>
63
    <tr>
64
        {{#osgood}}<td style="width: {{sidecolwidth}}; text-align: right;"></td>{{/osgood}}
65
        {{^osgood}}<td style="width: {{sidecolwidth}}"></td>{{/osgood}}
66
        {{#headers}}
67
        <td style="width:{{colwidth}}; text-align:center" class="{{bg}} smalltext">{{str}}</td>
68
        {{/headers}}
69
        {{#osgood}}<td style="width:{{sidecolwidth}};"></td>{{/osgood}}
70
    </tr>
71
    {{#rows}}
72
    <tr>
73
        <td style="text-align:{{textalign}}">{{{content}}}</td>
74
        {{#cols}}
75
        {{#checked}}
76
        <td style="text-align:center;" class="selected">
77
            <span class="selected"><input type="radio" name="{{str}}" checked="checked" disabled="disabled"/></span>
78
        </td>
79
        {{/checked}}
80
        {{^checked}}
81
        <td style="text-align:center;" class="{{bg}}">
82
            <span class="unselected"><input type="radio" disabled="disabled" name="{{str}}" onclick="this.checked=false;" /></span>
83
        </td>
84
        {{/checked}}
85
        {{/cols}}
86
        {{#osgood}}<td>{{{osgoodstr}}}</td>{{/osgood}}
87
    </tr>
88
    {{/rows}}
89
  </tbody>
90
</table>
91
</div>
92
<!-- End HTML generated from response_rate template. -->