1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
|
5 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
6 |
(at your option) any later version.
|
|
|
7 |
Moodle is distributed in the hope that it will be useful,
|
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
GNU General Public License for more details.
|
|
|
11 |
You should have received a copy of the GNU General Public License
|
|
|
12 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13 |
}}
|
|
|
14 |
{{!
|
|
|
15 |
@template mod_quiz/list_of_attempts
|
|
|
16 |
|
|
|
17 |
This template renders summary information about a list of quiz attempts.
|
|
|
18 |
|
|
|
19 |
The structure for each attempt should be what is required by mod_quiz/attempt_summary_information.
|
|
|
20 |
|
|
|
21 |
Example context (json):
|
|
|
22 |
{
|
|
|
23 |
"hasattempts": true,
|
|
|
24 |
"attempts": [
|
|
|
25 |
{
|
|
|
26 |
"name": "Attempt 1",
|
|
|
27 |
"reviewlink": "<a href='https://qa.moodledemo.net/mod/quiz/review.php?attempt=13&cmid=30'>Review</a>",
|
|
|
28 |
"summarydata": {
|
|
|
29 |
"hasitems": true,
|
|
|
30 |
"items": [
|
|
|
31 |
{
|
|
|
32 |
"title": "<img src='https://qa.moodledemo.net/pluginfile.php/27/user/icon/boost/f2?rev=5522' class='userpicture' width='35' height='35' alt='It is me!'>",
|
|
|
33 |
"content": "<a href='https://qa.moodledemo.net/user/view.php?id=4&course=2'>Sam Student</a>"
|
|
|
34 |
},
|
|
|
35 |
{"title": "Status", "content": "Finished"},
|
|
|
36 |
{"title": "Started", "content": "Thursday, 23 November 2023, 9:29 AM"},
|
|
|
37 |
{"title": "Completed", "content": "Thursday, 23 November 2023, 9:32 AM"},
|
|
|
38 |
{"title": "Duration", "content": "3 minutes"},
|
|
|
39 |
{"title": "Grade", "content": "Not yet graded"}
|
|
|
40 |
]
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
]
|
|
|
44 |
}
|
|
|
45 |
}}
|
|
|
46 |
{{#hasattempts}}
|
|
|
47 |
<h3>{{# str}}summaryofattempts, quiz{{/str}}</h3>
|
|
|
48 |
|
|
|
49 |
<ul class="list-unstyled row row-cols-1 row-cols-md-2 no-gutters">
|
|
|
50 |
|
|
|
51 |
{{#attempts}}
|
|
|
52 |
<li class="col pl-0 pr-2 mb-2">
|
|
|
53 |
<div class="card h-100">
|
|
|
54 |
<div class="card-header py-2 border-bottom-0">
|
|
|
55 |
<h4 class="card-title my-0">{{name}}</h4>
|
|
|
56 |
</div>
|
|
|
57 |
{{#summarydata}}
|
|
|
58 |
{{> mod_quiz/attempt_summary_information}}
|
|
|
59 |
{{/summarydata}}
|
|
|
60 |
<div class="card-body py-2">
|
|
|
61 |
<div>{{{reviewlink}}}</div>
|
|
|
62 |
</div>
|
|
|
63 |
</div>
|
|
|
64 |
</li>
|
|
|
65 |
{{/attempts}}
|
|
|
66 |
|
|
|
67 |
</ul>
|
|
|
68 |
|
|
|
69 |
{{/hasattempts}}
|