| 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_h5pactivity/reportattempts
|
|
|
19 |
|
|
|
20 |
This template will render the report link inside a H5P activity.
|
|
|
21 |
|
|
|
22 |
Variables required for this template:
|
|
|
23 |
* attempts - Full attempts list
|
|
|
24 |
|
|
|
25 |
Variables optional for this template:
|
|
|
26 |
* title - optional selected attempt name
|
|
|
27 |
* scored - The scored attempt
|
|
|
28 |
* attemptscount - The current number of attempts
|
|
|
29 |
|
|
|
30 |
Example context (json):
|
|
|
31 |
{
|
|
|
32 |
"attempts": [
|
|
|
33 |
{
|
|
|
34 |
"id": 7,
|
|
|
35 |
"h5pactivityid": 1,
|
|
|
36 |
"userid": 5,
|
|
|
37 |
"timecreated": 1587654916,
|
|
|
38 |
"timemodified": 1587654916,
|
|
|
39 |
"attempt": 1,
|
|
|
40 |
"rawscore": 6,
|
|
|
41 |
"maxscore": 6,
|
|
|
42 |
"duration": "14 seconds",
|
|
|
43 |
"durationcompact": "14''",
|
|
|
44 |
"completion": 1,
|
|
|
45 |
"completionicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
46 |
"success": 1,
|
|
|
47 |
"successicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
48 |
"scaled": 1,
|
|
|
49 |
"reporturl": {},
|
|
|
50 |
"score": "6 out of 6"
|
|
|
51 |
},
|
|
|
52 |
{
|
|
|
53 |
"id": 8,
|
|
|
54 |
"h5pactivityid": 1,
|
|
|
55 |
"userid": 5,
|
|
|
56 |
"timecreated": 1587654927,
|
|
|
57 |
"timemodified": 1587654927,
|
|
|
58 |
"attempt": 2,
|
|
|
59 |
"rawscore": 1,
|
|
|
60 |
"maxscore": 6,
|
|
|
61 |
"duration": "25 seconds",
|
|
|
62 |
"durationcompact": "25''",
|
|
|
63 |
"completion": 1,
|
|
|
64 |
"completionicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
65 |
"success": 0,
|
|
|
66 |
"successicon": "<i class=\"icon fa fa-circle-o fa-fw \"><\/i>",
|
|
|
67 |
"scaled": 0,
|
|
|
68 |
"reporturl": {},
|
|
|
69 |
"score": "1 out of 6"
|
|
|
70 |
},
|
|
|
71 |
{
|
|
|
72 |
"id": 9,
|
|
|
73 |
"h5pactivityid": 1,
|
|
|
74 |
"userid": 5,
|
|
|
75 |
"timecreated": 1587654942,
|
|
|
76 |
"timemodified": 1587654942,
|
|
|
77 |
"attempt": 3,
|
|
|
78 |
"rawscore": 3,
|
|
|
79 |
"maxscore": 6,
|
|
|
80 |
"duration": "40 seconds",
|
|
|
81 |
"durationcompact": "40''",
|
|
|
82 |
"completion": 1,
|
|
|
83 |
"completionicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
84 |
"success": 0,
|
|
|
85 |
"successicon": "<i class=\"icon fa fa-circle-o fa-fw \"><\/i>",
|
|
|
86 |
"scaled": 0,
|
|
|
87 |
"reporturl": {},
|
|
|
88 |
"score": "3 out of 6"
|
|
|
89 |
}
|
|
|
90 |
],
|
|
|
91 |
"user": {
|
|
|
92 |
"id": "5",
|
|
|
93 |
"auth": "manual",
|
|
|
94 |
"idnumber": "",
|
|
|
95 |
"firstname": "Miguel",
|
|
|
96 |
"lastname": "Alonso",
|
|
|
97 |
"email": "s3@example.com",
|
|
|
98 |
"institution": "Moodle HQ",
|
|
|
99 |
"department": "Development",
|
|
|
100 |
"address": "",
|
|
|
101 |
"city": "Barcelona",
|
|
|
102 |
"country": "ES",
|
|
|
103 |
"lang": "en",
|
|
|
104 |
"picture": "[USERPIC]",
|
|
|
105 |
"fullname": "Miguel Alonso"
|
|
|
106 |
},
|
|
|
107 |
"scored": {
|
|
|
108 |
"title": "Highest score attempt",
|
|
|
109 |
"attempts": [
|
|
|
110 |
{
|
|
|
111 |
"id": 7,
|
|
|
112 |
"h5pactivityid": 1,
|
|
|
113 |
"userid": 5,
|
|
|
114 |
"timecreated": 1587654916,
|
|
|
115 |
"timemodified": 1587654916,
|
|
|
116 |
"attempt": 1,
|
|
|
117 |
"rawscore": 6,
|
|
|
118 |
"maxscore": 6,
|
|
|
119 |
"duration": "14 seconds",
|
|
|
120 |
"durationcompact": "14''",
|
|
|
121 |
"completion": 1,
|
|
|
122 |
"completionicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
123 |
"success": 1,
|
|
|
124 |
"successicon": "<i class=\"icon fa fa-check-circle fa-fw \"><\/i>",
|
|
|
125 |
"scaled": 1,
|
|
|
126 |
"reporturl": {},
|
|
|
127 |
"score": "6 out of 6"
|
|
|
128 |
}
|
|
|
129 |
]
|
|
|
130 |
}
|
|
|
131 |
}
|
|
|
132 |
|
|
|
133 |
}}
|
|
|
134 |
{{#user}}
|
|
|
135 |
<h2 class="mb-4">
|
|
|
136 |
{{{picture}}}
|
|
|
137 |
{{#title}}{{title}}{{/title}}
|
|
|
138 |
{{^title}}{{#str}} attempts, mod_h5pactivity {{/str}}: {{fullname}}{{/title}}
|
|
|
139 |
</h2>
|
|
|
140 |
{{/user}}
|
|
|
141 |
|
|
|
142 |
{{#scored}}
|
|
|
143 |
<h3>{{title}}</h3>
|
|
|
144 |
{{>mod_h5pactivity/attempts}}
|
|
|
145 |
{{/scored}}
|
|
|
146 |
|
|
|
147 |
<h3>{{#str}}all_attempts, mod_h5pactivity{{/str}}</h3>
|
|
|
148 |
|
|
|
149 |
{{^attemptscount}}
|
|
|
150 |
<div class="alert alert-warning">
|
|
|
151 |
{{#str}} attempts_none, mod_h5pactivity {{/str}}
|
|
|
152 |
</div>
|
|
|
153 |
{{/attemptscount}}
|
|
|
154 |
{{#attemptscount}}
|
|
|
155 |
{{>mod_h5pactivity/attempts}}
|
|
|
156 |
{{/attemptscount}}
|