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 tool_lp/user_competency_summary_in_course
|
|
|
19 |
|
|
|
20 |
Moodle template for the the summary of a user competency
|
|
|
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 |
* usercompetencysummary - object containing:
|
|
|
30 |
* showrelatedcompetencies - boolean
|
|
|
31 |
* cangrade - boolean
|
|
|
32 |
* competency - competency summary record
|
|
|
33 |
* user - user record
|
|
|
34 |
* usercompetency - user competency record
|
|
|
35 |
* evidence - array of evidence
|
|
|
36 |
* course - course summary record
|
|
|
37 |
|
|
|
38 |
This template does not have an example context because it includes ajax functionality.
|
|
|
39 |
}}
|
|
|
40 |
{{#usercompetencysummary}}
|
|
|
41 |
<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
|
|
|
42 |
<div data-region="competency-summary">
|
|
|
43 |
{{#competency}}
|
|
|
44 |
{{> tool_lp/competency_summary }}
|
|
|
45 |
{{/competency}}
|
|
|
46 |
<dl>
|
|
|
47 |
<dt>{{#str}}activities, tool_lp{{/str}}</dt>
|
|
|
48 |
<dd data-region="coursecompetencyactivities">
|
|
|
49 |
<p>
|
|
|
50 |
<ul class="inline list-inline">
|
|
|
51 |
{{#coursemodules}}
|
|
|
52 |
<li class="list-inline-item"><a href="{{url}}"><img class="icon" src="{{iconurl}}" alt=""> {{name}} </a></li>
|
|
|
53 |
{{/coursemodules}}
|
|
|
54 |
{{^coursemodules}}
|
|
|
55 |
<li class="list-inline-item"><span class="alert">{{#str}}noactivities, tool_lp{{/str}}</span></li>
|
|
|
56 |
{{/coursemodules}}
|
|
|
57 |
</ul>
|
|
|
58 |
</p>
|
|
|
59 |
</dd>
|
|
|
60 |
{{#displayuser}}
|
|
|
61 |
{{#user}}
|
|
|
62 |
<dt>{{#str}}user{{/str}}</dt>
|
|
|
63 |
<dd>
|
|
|
64 |
{{>tool_lp/user_summary}}
|
|
|
65 |
</dd>
|
|
|
66 |
{{/user}}
|
|
|
67 |
{{/displayuser}}
|
|
|
68 |
<dt>{{#str}}userplans, competency{{/str}}</dt>
|
|
|
69 |
<dd>
|
|
|
70 |
<p>
|
|
|
71 |
<ul class="inline list-inline">
|
|
|
72 |
{{#plans}}
|
|
|
73 |
<li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
|
|
|
74 |
{{/plans}}
|
|
|
75 |
{{^plans}}
|
|
|
76 |
<li>{{#str}}nouserplanswithcompetency, competency{{/str}}</li>
|
|
|
77 |
{{/plans}}
|
|
|
78 |
</ul>
|
|
|
79 |
</p>
|
|
|
80 |
</dd>
|
|
|
81 |
{{#usercompetencycourse}}
|
|
|
82 |
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
|
|
83 |
<dd>
|
|
|
84 |
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
|
|
|
85 |
{{proficiencyname}}
|
|
|
86 |
</span>
|
|
|
87 |
</dd>
|
|
|
88 |
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
|
|
|
89 |
<dd>{{gradename}}
|
|
|
90 |
{{#cangrade}}
|
|
|
91 |
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
|
|
|
92 |
{{/cangrade}}
|
|
|
93 |
</dd>
|
|
|
94 |
{{/usercompetencycourse}}
|
|
|
95 |
{{#js}}
|
|
|
96 |
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
|
|
|
97 |
|
|
|
98 |
var competencyElement = $('[data-region-id="{{uniqid}}"]');
|
|
|
99 |
|
|
|
100 |
var displayuser = ('{{displayuser}}' == 'true') ? true : false;
|
|
|
101 |
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
|
|
|
102 |
{{#cangrade}}
|
|
|
103 |
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
|
|
|
104 |
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
|
|
|
105 |
{{/cangrade}}
|
|
|
106 |
});
|
|
|
107 |
|
|
|
108 |
{{/js}}
|
|
|
109 |
</dl>
|
|
|
110 |
{{#commentarea}}
|
|
|
111 |
{{#canpostorhascomments}}
|
|
|
112 |
{{>tool_lp/comment_area}}
|
|
|
113 |
{{/canpostorhascomments}}
|
|
|
114 |
{{/commentarea}}
|
|
|
115 |
<dl data-region="evidence-listing">
|
|
|
116 |
<dt>{{#str}}evidence, tool_lp{{/str}}</dt>
|
|
|
117 |
<dd>
|
|
|
118 |
{{#evidence}}
|
|
|
119 |
{{> tool_lp/evidence_summary }}
|
|
|
120 |
{{/evidence}}
|
|
|
121 |
{{^evidence}}
|
|
|
122 |
<p>{{#str}}noevidence, tool_lp{{/str}}</p>
|
|
|
123 |
{{/evidence}}
|
|
|
124 |
</dd>
|
|
|
125 |
</dl>
|
|
|
126 |
</div>
|
|
|
127 |
</div>
|
|
|
128 |
{{/usercompetencysummary}}
|