mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
123 lines
4.6 KiB
Text
123 lines
4.6 KiB
Text
{{!
|
|
This file is part of Moodle - http://moodle.org/
|
|
|
|
Moodle is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Moodle is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
}}
|
|
{{!
|
|
@template tool_lp/user_competency_summary_in_course
|
|
|
|
Moodle template for the the summary of a user competency
|
|
|
|
Classes required for JS:
|
|
* none
|
|
|
|
Data attributes required for JS:
|
|
* none
|
|
|
|
Context variables required for this template:
|
|
* usercompetencysummary - object containing:
|
|
* showrelatedcompetencies - boolean
|
|
* cangrade - boolean
|
|
* cansuggest - boolean
|
|
* cangradeorsuggest - boolean
|
|
* competency - competency summary record
|
|
* user - user record
|
|
* usercompetency - user competency record
|
|
* evidence - array of evidence
|
|
* course - course summary record
|
|
|
|
This template does not have an example context because it includes ajax functionality.
|
|
}}
|
|
{{#usercompetencysummary}}
|
|
<div data-region="user-competency-full-info" >
|
|
<div data-region="competency-summary">
|
|
{{#competency}}
|
|
{{> tool_lp/competency_summary }}
|
|
{{/competency}}
|
|
<dl>
|
|
{{#usercompetency}}
|
|
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
|
<dd>
|
|
<span class="label{{^proficiency}} label-important{{/proficiency}} pull-left">
|
|
{{proficiencyname}}
|
|
</span>
|
|
</dd>
|
|
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
|
|
<dd>{{gradename}}
|
|
{{#cangradeorsuggest}}
|
|
<p>
|
|
<form class="form-inline pull-left" id="grade-competency-form-{{uniqid}}">
|
|
<select></select>
|
|
<div class="btn-group">
|
|
{{#cangrade}}
|
|
<button class="btn btn-primary" data-action="grade">{{#str}}rate, tool_lp{{/str}}</button>
|
|
{{/cangrade}}
|
|
{{#cansuggest}}
|
|
<button class="btn btn-inverse" data-action="suggest">{{#str}}suggest, tool_lp{{/str}}</button>
|
|
{{/cansuggest}}
|
|
</div>
|
|
|
|
</form>
|
|
<br><br>
|
|
</p>
|
|
</dd>
|
|
{{#js}}
|
|
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
|
|
var scaleConfig = JSON.parse('{{{competency.scaleconfiguration}}}');
|
|
|
|
var inlineGrader = new mod('grade-competency-form-{{uniqid}}', scaleConfig, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
|
|
var competencyElement = $(document.getElementById('grade-competency-form-{{uniqid}}')).closest('[data-region=user-competency-full-info]');
|
|
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}');
|
|
|
|
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
|
|
});
|
|
|
|
{{/js}}
|
|
{{/cangradeorsuggest}}
|
|
{{/usercompetency}}
|
|
{{#usercompetencyplan}}
|
|
<dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd>
|
|
{{#cangradeorsuggest}}
|
|
{{$gradeform}}
|
|
<!-- Grading a user competency is specific to the context you are in. -->
|
|
{{/gradeform}}
|
|
{{/cangradeorsuggest}}
|
|
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
|
|
<dd>
|
|
<span class="label{{^proficiency}} label-important{{/proficiency}} pull-left">
|
|
{{proficiencyname}}
|
|
</span>
|
|
</dd>
|
|
{{/usercompetencyplan}}
|
|
</dl>
|
|
<dl data-region="evidence-listing">
|
|
<dt>{{#str}}evidence, tool_lp{{/str}}</dt>
|
|
<dd>
|
|
{{#evidence}}
|
|
{{> tool_lp/evidence_summary }}
|
|
{{/evidence}}
|
|
{{^evidence}}
|
|
<p>{{#str}}noevidence, tool_lp{{/str}}</p>
|
|
{{/evidence}}
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
{{/usercompetencysummary}}
|
|
|
|
{{#js}}
|
|
require(['tool_lp/competencydialogue'], function(Compdialogue) {
|
|
var competencydialogue = new Compdialogue({includerelated : true});
|
|
competencydialogue.watch('[data-region="competency-summary"]');
|
|
});
|
|
{{/js}}
|