Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
    <%# warning %>
70
    <ion-card class="ion-text-wrap core-warning-card">
71
        <ion-item>
72
            <ion-label class="ion-text-wrap">
73
                <ion-icon slot="start" name="fas-exclamation-triangle" color="warning" aria-hidden="true"></ion-icon>
74
                <% warning %>
75
            </ion-label>
76
        </ion-item>
77
    </ion-card>
78
    <%/ warning %>
79
 
80
    <ion-list>
81
        <%# hasprogress %>
82
        <ion-item>
83
            <ion-label>
84
                <core-progress-bar [progress]="<% progress %>"></core-progress-bar>
85
            </ion-label>
86
        </ion-item>
87
        <%/ hasprogress %>
88
 
89
        <%# hasgrade %>
90
        <ion-item>
91
            <ion-label>{{ 'plugin.mod_subcourse.currentgrade' | translate: {$a: '<% currentgrade %>'} }}</ion-label>
92
        </ion-item>
93
        <%/ hasgrade %>
94
 
95
        <%# refcourse %>
96
        <ion-button expand="block" class="ion-margin" core-link capture="true" href="<% refcourse.url %>">
97
            {{ 'plugin.mod_subcourse.gotorefcourse' | translate: {$a: '<% refcourse.fullname %>'} }}
98
        </ion-button>
99
        <%/ refcourse %>
100
    </ion-list>
101
</div>
102
 
103
<span core-site-plugins-call-ws-on-load
104
      name="mod_subcourse_view_subcourse"
105
      [params]="{subcourseid: <% subcourse.id %>}"
106
      [preSets]="{getFromCache: 0, saveToCache: 0}">
107
</span>