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 <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template mod_subcourse/mobile_view
|
|
|
19 |
|
|
|
20 |
Render the main view for the mobile app.
|
|
|
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 |
* cmid - [int] Course module identifier.
|
|
|
30 |
* subcourse - [object]
|
|
|
31 |
* subcourse.id - [int] Subcourse instance ID.
|
|
|
32 |
* subcourse.intro - [string] Formatted activity description.
|
|
|
33 |
* refcourse - [object]
|
|
|
34 |
* refcourse.fullname - [string] Formatted referenced course name.
|
|
|
35 |
* refcourse.url - [string] Referenced course view URL.
|
|
|
36 |
* hasprogress - [bool] Is the progress value set (not null).
|
|
|
37 |
* progress - [float] Percentual value of the progress in the referenced course.
|
|
|
38 |
* hasgrade - [bool] Is the currentgrade value set (not null).
|
|
|
39 |
* currentgrade - [string] Textual representation of the final grade in the referenced course.
|
|
|
40 |
* warning - [string] Warning to be displayed to the user.
|
|
|
41 |
|
|
|
42 |
Example context (json):
|
|
|
43 |
{
|
|
|
44 |
"cmid": 42,
|
|
|
45 |
"subcourse": {
|
|
|
46 |
"id": 24,
|
|
|
47 |
"intro": "<h3>Subcourse activity description</h3>"
|
|
|
48 |
},
|
|
|
49 |
"refcourse": {
|
|
|
50 |
"fullname": "Subcourse A.100",
|
|
|
51 |
"url": "https://my.school.edu/lms/course/view.php?id=43"
|
|
|
52 |
},
|
|
|
53 |
"hasprogress": true,
|
|
|
54 |
"progress": 100,
|
|
|
55 |
"hasgrade": true,
|
|
|
56 |
"currentgrade": "80.00",
|
|
|
57 |
"warning": ""
|
|
|
58 |
}
|
|
|
59 |
}}
|
|
|
60 |
|
|
|
61 |
{{=<% %>=}}
|
|
|
62 |
<div>
|
|
|
63 |
<core-course-module-description
|
|
|
64 |
description="<% subcourse.intro %>"
|
|
|
65 |
component="mod_subcourse"
|
|
|
66 |
componentId="<% cmid %>">
|
|
|
67 |
</core-course-module-description>
|
|
|
68 |
|
|
|
69 |
<ion-list>
|
|
|
70 |
<%# warning %>
|
|
|
71 |
<ion-item color="warning">
|
|
|
72 |
<ion-label><% warning %></ion-label>
|
|
|
73 |
</ion-item>
|
|
|
74 |
<%/ warning %>
|
|
|
75 |
|
|
|
76 |
<%# hasprogress %>
|
|
|
77 |
<ion-item>
|
|
|
78 |
<core-progress-bar [progress]="<% progress %>"></core-progress-bar>
|
|
|
79 |
</ion-item>
|
|
|
80 |
<%/ hasprogress %>
|
|
|
81 |
|
|
|
82 |
<%# hasgrade %>
|
|
|
83 |
<ion-item>
|
|
|
84 |
<ion-label>{{ 'plugin.mod_subcourse.currentgrade' | translate: {$a: '<% currentgrade %>'} }}</ion-label>
|
|
|
85 |
</ion-item>
|
|
|
86 |
<%/ hasgrade %>
|
|
|
87 |
|
|
|
88 |
<%# refcourse %>
|
|
|
89 |
<ion-item>
|
|
|
90 |
<button ion-button core-link capture="true" href="<% refcourse.url %>">
|
|
|
91 |
{{ 'plugin.mod_subcourse.gotorefcourse' | translate: {$a: '<% refcourse.fullname %>'} }}
|
|
|
92 |
</button>
|
|
|
93 |
</ion-item>
|
|
|
94 |
<%/ refcourse %>
|
|
|
95 |
</ion-list>
|
|
|
96 |
</div>
|
|
|
97 |
|
|
|
98 |
<span core-site-plugins-call-ws-on-load
|
|
|
99 |
name="mod_subcourse_view_subcourse"
|
|
|
100 |
[params]="{subcourseid: <% subcourse.id %>}"
|
|
|
101 |
[preSets]="{getFromCache: 0, saveToCache: 0}">
|
|
|
102 |
</span>
|