1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - https://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 <https://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template mod_subcourse/subcourseinfo
|
|
|
19 |
|
|
|
20 |
Displays percentage progress and the current grade in the subcourse.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* haspercentage (bool)
|
|
|
30 |
* hasstrgrade (bool)
|
|
|
31 |
* percentage (int)
|
|
|
32 |
* strgrade (string)
|
|
|
33 |
|
|
|
34 |
Example context (json):
|
|
|
35 |
{
|
|
|
36 |
"haspercentage" : true,
|
|
|
37 |
"hasstrgrade" : true,
|
|
|
38 |
"percentage" : 42,
|
|
|
39 |
"strgrade" : 12.00
|
|
|
40 |
}
|
|
|
41 |
}}
|
|
|
42 |
<div class="row">
|
|
|
43 |
{{#haspercentage}}
|
|
|
44 |
<div class="col-md">
|
|
|
45 |
<div class="subcourseinfo subcourseinfo-progress mb-3">
|
|
|
46 |
<div class="infotext">{{#str}} currentprogress, mod_subcourse, {{percentage}} {{/str}}</div>
|
|
|
47 |
<div class="subcourse-progress-bar">
|
|
|
48 |
<div style="width: {{percentage}}%"></div>
|
|
|
49 |
</div>
|
|
|
50 |
</div>
|
|
|
51 |
</div>
|
|
|
52 |
{{/haspercentage}}
|
|
|
53 |
|
|
|
54 |
{{#hasstrgrade}}
|
|
|
55 |
<div class="col-md">
|
|
|
56 |
<div class="subcourseinfo subcourseinfo-grade mb-3">
|
|
|
57 |
<div class="infotext">{{#str}} currentgrade, mod_subcourse, {{strgrade}} {{/str}}</div>
|
|
|
58 |
</div>
|
|
|
59 |
</div>
|
|
|
60 |
{{/hasstrgrade}}
|
|
|
61 |
</div>
|