2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template tool_lp/user_competency_summary_in_course
20 Moodle template for the the summary of a user competency
22 Classes required for JS:
25 Data attributes required for JS:
28 Context variables required for this template:
29 * usercompetencysummary - object containing:
30 * showrelatedcompetencies - boolean
32 * competency - competency summary record
34 * usercompetency - user competency record
35 * evidence - array of evidence
36 * course - course summary record
38 This template does not have an example context because it includes ajax functionality.
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">
44 {{> tool_lp/competency_summary }}
47 <dt>{{#str}}activities, tool_lp{{/str}}</dt>
48 <dd data-region="coursecompetencyactivities">
50 <ul class="inline list-inline">
52 <li class="list-inline-item"><a href="{{url}}"><img src="{{iconurl}}"> {{name}} </a></li>
55 <li class="list-inline-item"><span class="alert">{{#str}}noactivities, tool_lp{{/str}}</span></li>
62 <dt>{{#str}}user{{/str}}</dt>
64 {{>tool_lp/user_summary}}
68 <dt>{{#str}}userplans, competency{{/str}}</dt>
71 <ul class="inline list-inline">
73 <li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
76 <li>{{#str}}nouserplanswithcompetency, competency{{/str}}</li>
81 {{#usercompetencycourse}}
82 <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
84 <span class="badge{{^proficiency}} badge-danger{{/proficiency}} float-left">
88 <dt>{{#str}}rating, tool_lp{{/str}}</dt>
91 <button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
94 {{/usercompetencycourse}}
96 require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
98 var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
99 var competencyElement = $('[data-region-id="{{uniqid}}"]');
101 var displayuser = ('{{displayuser}}' == 'true') ? true : false;
102 var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
104 inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
110 {{#canpostorhascomments}}
111 {{>tool_lp/comment_area}}
112 {{/canpostorhascomments}}
114 <dl data-region="evidence-listing">
115 <dt>{{#str}}evidence, tool_lp{{/str}}</dt>
118 {{> tool_lp/evidence_summary }}
121 <p>{{#str}}noevidence, tool_lp{{/str}}</p>
127 {{/usercompetencysummary}}