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/question_rate
19
 
20
    Template which defines a rate type question 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
        "qelements": [
33
            {
34
                "twidth": "100%",
35
                "headerrow": {
36
                    "col1width": "100%",
37
                    "colnya": 1,
38
                    "cols": [
39
                        {
40
                            "colwidth": "100%",
41
                            "coltext": "<div>Header 1</div>"
42
                        },
43
                        {
44
                            "colwidth": "100%",
45
                            "coltext": "<div>Header 1</div>"
46
                        }
47
                    ]
48
                },
49
                "rows": [
50
                    {
51
                        "cols": [
52
                            {
53
                                "colstyle": "columnstyle",
54
                                "colclass": "columnclass",
55
                                "coltitle": "columntitle",
56
                                "coltext": "<div>HTML of column text.</div>",
57
                                "colhiddentext": "<div>HTML of column hidden text.",
58
                                "colinput": {
59
                                    "name": "input1",
60
                                    "id": "id1",
61
                                    "checked": 1,
62
                                    "disabled": 0,
63
                                    "onclick": "dosomething()",
64
                                    "label": "<div>HTML of label</div>"
65
                                }
66
                            },
67
                            {
68
                                "colstyle": "columnstyle",
69
                                "colclass": "columnclass",
70
                                "coltitle": "columntitle",
71
                                "coltext": "<div>HTML of column text.</div>",
72
                                "colhiddentext": "<div>HTML of column hidden text.",
73
                                "colinput": {
74
                                    "name": "input2",
75
                                    "id": "id2",
76
                                    "checked": 1,
77
                                    "disabled": 0,
78
                                    "onclick": "dosomething()",
79
                                    "label": "<div>HTML of label</div>"
80
                                }
81
                            }
82
                        ]
83
                    },
84
                    {
85
                        "cols": [
86
                            {
87
                                "colstyle": "columnstyle",
88
                                "colclass": "columnclass",
89
                                "coltitle": "columntitle",
90
                                "coltext": "<div>HTML of column text.</div>",
91
                                "colhiddentext": "<div>HTML of column hidden text.",
92
                                "colinput": {
93
                                    "name": "input3",
94
                                    "id": "id3",
95
                                    "checked": 1,
96
                                    "disabled": 0,
97
                                    "onclick": "dosomething()",
98
                                    "label": "<div>HTML of label</div>"
99
                                }
100
                            },
101
                            {
102
                                "colstyle": "columnstyle",
103
                                "colclass": "columnclass",
104
                                "coltitle": "columntitle",
105
                                "coltext": "<div>HTML of column text.</div>",
106
                                "colhiddentext": "<div>HTML of column hidden text.",
107
                                "colinput": {
108
                                    "name": "input4",
109
                                    "id": "id4",
110
                                    "checked": 1,
111
                                    "disabled": 0,
112
                                    "onclick": "dosomething()",
113
                                    "label": "<div>HTML of label</div>"
114
                                }
115
                            }
116
                        ]
117
                    }
118
                ]
119
            }
120
        ]
121
    }
122
    }}
123
<!-- Begin HTML generated from question_rate template. -->
124
{{#qelements}}
125
<table style="width:{{twidth}}">
126
  <tbody>
127
    {{#qelements.headerrow}}
128
    <tr>
129
      <td style="width:{{col1width}}"></td>
130
      {{#colnya}}<td title="nya"></td>{{/colnya}}
131
      {{#cols}}
132
      <td style="width:{{colwidth}}; text-align:center;" class="smalltext">{{{coltext}}}</td>
133
      {{/cols}}
134
    {{/qelements.headerrow}}
135
    {{#qelements.rows}}
136
    <tr class="raterow">
137
      {{#cols}}
138
      <td {{#colstyle}}style="{{.}}"{{/colstyle}}{{#colclass}} class="{{.}}"{{/colclass}}{{#coltitle}} title="{{.}}"{{/coltitle}}
139
			{{#colinput}} onclick="if('{{id}}'.length>0) document.getElementById('{{id}}').click()"{{/colinput}}>
140
        {{#coltext}}{{{.}}}{{/coltext}}
141
        {{#colhiddentext}}<span class="accesshide">{{{.}}}</span>{{/colhiddentext}}
142
        {{#colinput}}<input type="radio" name="{{name}}" id="{{id}}" value="{{value}}"{{#checked}} checked="checked"{{/checked}}{{#disabled}} disabled="disabled"{{/disabled}}{{#onclick}} onclick="{{.}}"{{/onclick}}>
143
        {{#label}}<label for="{{id}}" class="accesshide">{{{.}}}</label>{{/label}}{{/colinput}}
144
      </td>
145
      {{/cols}}
146
    </tr>
147
    {{/qelements.rows}}
148
  </tbody>
149
</table>
150
{{/qelements}}
151
<!-- End HTML generated from question_rate template. -->