Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 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 core_question/view_banks
19
 
20
    Example context (json):
21
{
22
    "addqbank": {
23
        "id": "single_button669e2ffb6fafe23",
24
        "formid": null,
25
        "method": "post",
26
        "url": "/course/modedit.php",
27
        "label": "Add",
28
        "classes": "singlebutton",
29
        "disabled": false,
30
        "tooltip": null,
31
        "type": "primary",
32
        "attributes": [],
33
        "params": [
34
            {
35
                "name": "add",
36
                "value": "qbank"
37
            },
38
            {
39
                "name": "course",
40
                "value": "1"
41
            },
42
            {
43
                "name": "section",
44
                "value": "0"
45
            },
46
            {
47
                "name": "return",
48
                "value": "0"
49
            },
50
            {
51
                "name": "sr",
52
                "value": "0"
53
            },
54
            {
55
                "name": "beforemod",
56
                "value": "0"
57
            },
58
            {
59
                "name": "sesskey",
60
                "value": "abcde1234"
61
            }
62
        ],
63
        "actions": [],
64
        "hasactions": false
65
    },
66
    "hassharedbanks": true,
67
    "sharedbanks": [
68
        {
69
            "purpose": "content",
70
            "iconurl": {},
71
            "modname": "Question bank 1",
72
            "description": "<div class=\"no-overflow\">Description<\/div>",
73
            "managequestions": {
74
                "id": "action_link669e2ffb6fafe13",
75
                "disabled": false,
76
                "text": "Question bank 1",
77
                "url": "/mod/qbank/view.php?id=1",
78
                "icon": null,
79
                "classes": "",
80
                "attributes": [],
81
                "actions": [],
82
                "hasactions": false
83
            },
84
            "managebank": {
85
                "instance": 1,
86
                "classes": "moodle-actionmenu",
87
                "attributes": [
88
                    {
89
                        "name": "id",
90
                        "value": "action-menu-1"
91
                    },
92
                    {
93
                        "name": "data-enhance",
94
                        "value": "moodle-core-actionmenu"
95
                    }
96
                ],
97
                "primary": {
98
                    "title": "",
99
                    "prioritise": false,
100
                    "classes": "menubar",
101
                    "attributes": [
102
                        {
103
                            "name": "id",
104
                            "value": "action-menu-1-menubar"
105
                        }
106
                    ],
107
                    "triggerattributes": [],
108
                    "menutrigger": "<i class=\"icon fa fa-ellipsis-v fa-fw \"  title=\"Edit\" role=\"img\" aria-label=\"Edit\"><\/i>",
109
                    "triggerextraclasses": "btn btn-icon d-flex no-caret ",
110
                    "triggerrole": "button",
111
                    "iconraw": "",
112
                    "actiontext": "",
113
                    "items": []
114
                },
115
                "secondary": {
116
                    "classes": "menu",
117
                    "attributes": [
118
                        {
119
                            "name": "id",
120
                            "value": "action-menu-1-menu"
121
                        },
122
                        {
123
                            "name": "data-rel",
124
                            "value": "menu-content"
125
                        },
126
                        {
127
                            "name": "aria-labelledby",
128
                            "value": "action-menu-toggle-1"
129
                        },
130
                        {
131
                            "name": "role",
132
                            "value": "menu"
133
                        }
134
                    ],
135
                    "items": [
136
                        {
137
                            "simpleitem": false,
138
                            "actionmenulink": {
139
                                "id": "action_link669e2ffb6fafe7",
140
                                "disabled": false,
141
                                "text": "Edit settings",
142
                                "url": "/course/mod.php?sesskey=abcde12345&update=2",
143
                                "icon": {
144
                                    "key": "t\/edit",
145
                                    "component": "moodle",
146
                                    "title": ""
147
                                },
148
                                "classes": "editing_update menu-action",
149
                                "attributes": [
150
                                    {
151
                                        "name": "data-action",
152
                                        "value": "update"
153
                                    },
154
                                    {
155
                                        "name": "role",
156
                                        "value": "menuitem"
157
                                    },
158
                                    {
159
                                        "name": "tabindex",
160
                                        "value": "-1"
161
                                    }
162
                                ],
163
                                "actions": [],
164
                                "hasactions": false,
165
                                "showtext": true
166
                            }
167
                        },
168
                        {
169
                            "simpleitem": false,
170
                            "actionmenulink": {
171
                                "id": "action_link669e2ffb6fafe11",
172
                                "disabled": false,
173
                                "text": "Assign roles",
174
                                "url": "/admin/roles/assign.php?contextid=1",
175
                                "icon": {
176
                                    "key": "t\/assignroles",
177
                                    "component": "moodle",
178
                                    "title": ""
179
                                },
180
                                "classes": "editing_assign menu-action",
181
                                "attributes": [
182
                                    {
183
                                        "name": "data-action",
184
                                        "value": "assignroles"
185
                                    },
186
                                    {
187
                                        "name": "data-sectionreturn",
188
                                        "value": null
189
                                    },
190
                                    {
191
                                        "name": "role",
192
                                        "value": "menuitem"
193
                                    },
194
                                    {
195
                                        "name": "tabindex",
196
                                        "value": "-1"
197
                                    }
198
                                ],
199
                                "actions": [],
200
                                "hasactions": false,
201
                                "showtext": true
202
                            }
203
                        },
204
                        {
205
                            "simpleitem": false,
206
                            "actionmenulink": {
207
                                "id": "action_link669e2ffb6fafe12",
208
                                "disabled": false,
209
                                "text": "Delete",
210
                                "url": "/course/mod.php?sesskey=abcde12345&delete=2",
211
                                "icon": {
212
                                    "key": "t\/delete",
213
                                    "component": "moodle",
214
                                    "title": ""
215
                                },
216
                                "classes": "editing_delete text-danger menu-action",
217
                                "attributes": [
218
                                    {
219
                                        "name": "data-action",
220
                                        "value": "cmDelete"
221
                                    },
222
                                    {
223
                                        "name": "data-sectionreturn",
224
                                        "value": null
225
                                    },
226
                                    {
227
                                        "name": "data-id",
228
                                        "value": "2"
229
                                    },
230
                                    {
231
                                        "name": "role",
232
                                        "value": "menuitem"
233
                                    },
234
                                    {
235
                                        "name": "tabindex",
236
                                        "value": "-1"
237
                                    }
238
                                ],
239
                                "actions": [],
240
                                "hasactions": false,
241
                                "showtext": true
242
                            }
243
                        }
244
                    ]
245
                },
246
                "dropdownalignment": "dropdown-menu-right"
247
            }
248
        }
249
    ],
250
    "hasprivatebanks": true,
251
    "privatebanks": [
252
        {
253
            "purpose": "assessment",
254
            "iconurl": {},
255
            "modname": "Quiz 1",
256
            "description": "",
257
            "managequestions": {
258
                "id": "action_link669e2ffb6fafe21",
259
                "disabled": false,
260
                "text": "Quiz 1",
261
                "url": "/mod/quiz/view.php?id=1",
262
                "icon": null,
263
                "classes": "",
264
                "attributes": [],
265
                "actions": [],
266
                "hasactions": false
267
            },
268
            "managebank": null
269
        }
270
    ],
271
    "addcustombanks": [],
272
    "createdefault": {
273
        "id": "single_button669e2ffb6fafe24",
274
        "formid": null,
275
        "method": "post",
276
        "url": "/question/banks.php",
277
        "label": "Create default question bank",
278
        "classes": "singlebutton",
279
        "disabled": false,
280
        "tooltip": null,
281
        "type": "secondary",
282
        "attributes": [],
283
        "params": [
284
            {
285
                "name": "courseid",
286
                "value": "1"
287
            },
288
            {
289
                "name": "createdefault",
290
                "value": "1"
291
            },
292
            {
293
                "name": "sesskey",
294
                "value": "abcde12345"
295
            }
296
        ],
297
        "actions": [],
298
        "hasactions": false
299
    }
300
}
301
}}
302
<h2>{{#str}}banksincourse, question{{/str}} {{#addqbank}}<div class="float-end">{{> core/single_button }}</div>{{/addqbank}}</h2>
303
 
304
{{#addcustombanks}}
305
    <div class="add-bank pt-2">
306
        <ul class="list-unstyled">
307
            <li>
308
                {{> core/action_link}}
309
            </li>
310
        </ul>
311
    </div>
312
{{/addcustombanks}}
313
 
314
{{^sharedbanks}}
315
    <div class="alert alert-info">
316
        {{#str}}nobanks, question{{/str}}
317
        {{#createdefault}}
318
            <div>
319
                {{> core/single_button }}
320
            </div>
321
        {{/createdefault}}
322
    </div>
323
{{/sharedbanks}}
324
 
325
{{#hassharedbanks}}
326
    <div class="shared-banks">
327
        {{#sharedbanks}}
328
            {{< core_question/question_banks_list}}
329
            {{/core_question/question_banks_list}}
330
        {{/sharedbanks}}
331
    </div>
332
{{/hassharedbanks}}
333
 
334
{{#hasprivatebanks}}
335
    <div class="private-banks pt-5">
336
        <h2>{{#str}}otherbanks, question{{/str}}</h2>
337
        <p>{{#str}}otherbanksdesc, question{{/str}}</p>
338
        {{#privatebanks}}
339
            {{< core_question/question_banks_list}}
340
            {{/core_question/question_banks_list}}
341
        {{/privatebanks}}
342
    </div>
343
{{/hasprivatebanks}}