first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,58 @@
{{!
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/action_selector
Select an action to execute.
Classes required for JS:
* none
Data attibutes required for JS:
* none
Context variables required for this template:
* message - The message to explain why we ask user to select an action
* choices - List of possible actions
* confirm - Text for button confirms
* cancel - Text for button cancel
Example context (json):
{
"message": "Message",
"choices": [
{ "value": "1", "text": "One" },
{ "value": "2", "text": "Two" }
],
"confirm": "Confirm",
"cancel": "Cancel"
}
}}
<div data-region="action-selector">
<div data-region="action-selector-message">
{{message}}<br>
</div><br>
<div data-region="action-selector-radio-buttons">
{{#choices}}
<input id="action-selection-option-{{value}}" type="radio" class="mr-1" name="choice" value="{{value}}"/><label for="action-selection-option-{{value}}">{{text}}</label><br>
{{/choices}}
</div><br>
<div data-region="action_selector-buttons">
<input type="button" data-action="action-selector-confirm" class="btn btn-primary" value="{{confirm}}"/>
<input type="button" data-action="action-selector-cancel" class="btn btn-secondary" value="{{cancel}}"/>
</div>
</div>
@@ -0,0 +1,114 @@
{{!
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/comment_area
IDs required for JS:
* all
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* autostart
* canpost
* cid
* collapsediconkey
* commentarea
* component
* contextid
* count
* courseid
* displaycancel
* fullwidth
* itemid
* linktext
* notoggle
* displaytotalcount
* template
* uniqid
// This template has no example context because it would trigger real updates to the DB.
Example context (json):
{
}
}}
<div style="display: none;" id="cmt-tmpl">{{{template}}}</div>
<div class="mdl-left">
{{^notoggle}}
<a href="#" class="comment-link" id="comment-link-{{cid}}">
{{#pix}}{{collapsediconkey}}, core, {{linktext}}{{/pix}}<span id="comment-link-text-{{cid}}">{{linktext}}
{{#displaytotalcount}}
({{count}})
{{/displaytotalcount}}</span>
</a>
{{/notoggle}}
<div id="comment-ctrl-{{cid}}" class="comment-ctrl">
<ul id="comment-list-{{cid}}" class="comment-list">
<li class="first"></li>
</ul>
<div id="comment-pagination-{{cid}}" class="comment-pagination"></div>
{{#canpost}}
<div class="comment-area">
<div class="db">
<textarea name="context" id="dlg-content-{{cid}}" rows="2" {{^fullwidth}}cols="20"{{/fullwidth}}{{#fullwidth}}class="fullwidth"{{/fullwidth}}></textarea>
</div>
<div class="fd" id="comment-action-{{cid}}">
<a href="#" id="comment-action-post-{{cid}}">{{#str}}savecomment{{/str}}</a>
{{#displaycancel}}
| <a href="#" id="comment-action-cancel-{{cid}}">{{#str}}cancel{{/str}}</a>
{{/displaycancel}}
</div>
</div>
<div class="clearer"></div>
{{/canpost}}
</div>
</div>
{{#js}}
require(['core/str'], function(Str) {
// Preloading strings.
Str.get_strings([
{ key: 'addcomment', component: 'moodle' },
{ key: 'comments', component: 'moodle' },
{ key: 'commentscount', component: 'moodle' },
{ key: 'commentsrequirelogin', component: 'moodle' },
{ key: 'deletecommentbyon', component: 'moodle' },
]).then(function() {
// Kick off when strings are loaded.
Y.use('core_comment', function(Y) {
M.core_comment.init(Y, {
client_id: '{{cid}}',
commentarea: '{{commentarea}}',
itemid: {{itemid}},
page: 0,
courseid: {{courseid}},
contextid: {{contextid}},
component: '{{component}}',
notoggle: false, // {{notoggle}} True not supported just yet.
autostart: false // {{autostart}} True not supported just yet.
});
});
});
})
{{/js}}
@@ -0,0 +1,60 @@
{{!
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/competencies_move_tree
Manage competencies template.
Classes required for JS:
Data attibutes required for JS:
* data-enhance=movetree
Context variables required for this template:
* framework -
* competencies - array of objects containing id, shortname, idnumber, sortorder, parentid, competencyframeworkid, path
Example context (json):
{
"framework": {
"shortname":"framework"
},
"competencies": [
{ "name": "Competency", "id": 1 }
]
}
}}
<div data-region="competencymovetree" >
<label>{{#str}}selectcompetencymovetarget, tool_lp{{/str}}</label>
<ul data-enhance="movetree" style="display: none;">
<li>
<span>{{{framework.shortname}}}</span>
<ul>
{{#competencies}}
{{> tool_lp/competencies_tree }}
{{/competencies}}
</ul>
</li>
</ul>
</div>
<div data-region="move-buttons" class="float-sm-right">
<input type="button" data-action="move" class="btn btn-primary" value="{{#str}}move{{/str}}"/>
<input type="button" data-action="cancel" class="btn btn-secondary" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
@@ -0,0 +1,70 @@
{{!
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/competencies_tree
Recursively build a competencies tree.
Classes required for JS:
Data attibutes required for JS:
* data-enhance=movetree
Context variables required for this template:
* id, shortname, idnumber, sortorder, parentid, competencyframeworkid, path, children
Example context (json):
{
"id": 1,
"shortname": "short",
"idnumber": "SHORT",
"sortorder": 1,
"parentid": 0,
"competencyframeworkid": 1,
"path": "/",
"haschildren": true,
"children": [{
"id": 2,
"shortname": "child",
"idnumber": "CHILD",
"sortorder": 1,
"parentid": 1,
"competencyframeworkid": 1,
"path": "/1/",
"children": []
}]
}
}}
<li data-id="{{id}}">
{{#canmanage}}
<span draggable="true">
{{{shortname}}}
</span>
{{/canmanage}}
{{^canmanage}}
<span>
{{{shortname}}}
</span>
{{/canmanage}}
{{#haschildren}}
<ul>
{{#children}}
{{> tool_lp/competencies_tree }}
{{/children}}
</ul>
{{/haschildren}}
</li>
@@ -0,0 +1,54 @@
{{!
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/competencies_tree_root
Recursively build a competencies tree.
Classes required for JS:
Data attibutes required for JS:
* data-enhance=movetree
Context variables required for this template:
* id, shortname, idnumber, sortorder, parentid, competencyframeworkid, path, children
Example context (json):
{
"shortname": "short",
"haschildren": true,
"competencies": [{
"id": 2,
"shortname": "child",
"idnumber": "CHILD",
"sortorder": 1,
"parentid": 1,
"competencyframeworkid": 1,
"path": "/1/",
"children": []
}]
}
}}
<ul data-enhance="tree" class="competency-tree">
<li><span>{{{shortname}}}</span>
<ul>
{{#competencies}}
{{> tool_lp/competencies_tree }}
{{/competencies}}
</ul>
</li>
</ul>
@@ -0,0 +1,59 @@
{{!
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/competency_grader
Template for grading a competency.
Classes required for JS:
None
Data required for JS:
* ratings - list of value, name selected for valid ratings
Example context (json):
{
"ratings": [
{"name": "Bad", "value": 0, "selected": true},
{"name": "OK", "value": 1},
{"name": "Good", "value": 2}
]
}
}}
<div class="competency-grader" data-region="competency-grader">
<form>
<div class="content">
<div data-region="rating">
<label for="rating_{{uniqid}}">{{#str}}rating, tool_lp{{/str}}</label>
<select name="rating" id="rating_{{uniqid}}" class="custom-select">
{{#ratings}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/ratings}}
</select>
</div>
<div data-region="comment" class="mt-1">
<label for="comment_{{uniqid}}">{{#str}}ratecomment, tool_lp{{/str}}</label>
<textarea name="comment" id="comment_{{uniqid}}" class="form-control mb-1"></textarea>
</div>
</div>
<div data-region="footer" class="float-sm-right">
<button data-action="rate" class="btn btn-primary">{{#str}}rate, tool_lp{{/str}}</button>
<button data-action="cancel" class="btn btn-secondary">{{#str}}cancel{{/str}}</button>
</div>
<div class="clearfix"></div>
</form>
</div>
@@ -0,0 +1,85 @@
{{!
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/competency_path
Competency path template.
Classes required for JS:
* competencydialogue
Context variables required for this template:
* framework - The competency framework
* id - competency id
* name - competency idnumber
* ancestors - array of nodes
* id - competency id
* name - competency idnumber
* first - true if node is in first position
* last - true if node is in last position
* pluginbaseurl - base url of plugin tool_lp
Example context (json):
{
"framework": {
"id": "1",
"name": "Framework"
},
"ancestors": [
{
"id": "1",
"name": "C1"
},
{
"id": "1",
"name": "C2",
"last": true
}
]
}
}}
<nav id="competency-path-{{uniqid}}">
<small>
{{#showlinks}}
<a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{framework.id}}&pagecontextid={{pagecontextid}}" >
{{{framework.name}}}
</a>
{{/showlinks}}
{{^showlinks}}
{{{framework.name}}}
{{/showlinks}}
/
{{#ancestors}}
{{#showlinks}}
<a href="{{pluginbaseurl}}/competencies.php?competencyid={{id}}">
{{{name}}}
</a>
{{/showlinks}}
{{^showlinks}}
{{{name}}}
{{/showlinks}}
{{^last}}<span> / </span>{{/last}}
{{/ancestors}}
</small>
</nav>
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
Compdialogue.init();
});
{{/js}}
@@ -0,0 +1,86 @@
{{!
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/competency_picker
Show a competency tree and allow picking a competency.
Context variables required for this template:
* frameworks - array of competency framework
* id
* shortname
* idnumber
* selected
* framework - competency framework
* id
* name
* shortname
* idnumber
* competencies - array of nodes
* id - competency id
* name - competency idnumber
* children - array of children
* haschildren - boolean
Example context (json):
{
"frameworks": [
{
"id": "1",
"shortname": "Framework",
"idnumber": "F1"
}
],
"competencies": [
]
}
}}
<div data-region="competencylinktree">
{{^singleFramework}}
<h3>{{#str}}competencyframeworks, tool_lp{{/str}}</h3>
<select data-action="chooseframework" class="custom-select">
{{#frameworks}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} <em>{{idnumber}}</em></option>
{{/frameworks}}
</select>
{{/singleFramework}}
<h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>
<form data-region="filtercompetencies" class="d-flex flex-wrap align-items-center" data-frameworkid="{{framework.id}}">
<div class="mb-3 d-flex">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
<button class="btn btn-secondary ml-1">{{#pix}}a/search, ,{{#str}}search{{/str}}{{/pix}}</button>
</div>
</form>
<ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
<li><span>{{{framework.shortname}}}</span>
<ul>
{{#competencies}}
{{> tool_lp/competencies_tree }}
{{/competencies}}
</ul>
</li>
</ul>
<div data-region="link-buttons" class="mt-1 float-sm-right">
<input type="button" class="btn btn-primary" data-action="add" value="{{#str}}add{{/str}}"/>
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
</div>
@@ -0,0 +1,68 @@
{{!
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/competency_picker_competencyform
Show a competency tree and allow picking a competency.
Context variables required for this template:
* framework - The competency framework
* id
* name
* shortname
* competencies - array of nodes
* id - competency id
* name - competency idnumber
* children - array of children
* haschildren - boolean
Example context (json):
{
"framework": {
"id": "1",
"name": "Framework"
},
"competencies": [
]
}
}}
<div data-region="competencylinktree">
<h3>{{#str}}locatecompetency, tool_lp{{/str}}</h3>
<form data-region="filtercompetencies" class="d-flex flex-wrap align-items-center" data-frameworkid="{{framework.id}}">
<div class="mb-3 d-flex">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
<button class="btn btn-secondary ml-1">{{#pix}}a/search, ,{{#str}}search{{/str}}{{/pix}}</button>
</div>
</form>
<ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
<li data-id="0"><span>{{{framework.shortname}}}</span>
<ul>
{{#competencies}}
{{> tool_lp/competencies_tree }}
{{/competencies}}
</ul>
</li>
</ul>
<div data-region="link-buttons" class="mt-1 float-sm-right">
<input type="button" class="btn btn-primary" data-action="add" value="{{#str}}select{{/str}}"/>
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
</div>
@@ -0,0 +1,92 @@
{{!
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/competency_picker_user_plans
Show a competency tree and allow picking a competency.
Context variables required for this template:
* singlePlan - boolean
* plans - array of plans
* id
* selected
* name
* plan
* id
* name
* competencies - array of nodes
* id - competency id
* name - competency idnumber
* children - array of children
* haschildren - boolean
Example context (json):
{
"singlePlan": false,
"plans": [
{
"id": "1",
"name": "Plan"
}
],
"plan": {
"id": "1",
"name": "Plan"
},
"competencies": []
}
}}
<div data-region="competencylinktree">
{{^singlePlan}}
<h3>{{#str}}learningplans, tool_lp{{/str}}</h3>
<select data-action="chooseplan" class="custom-select">
{{#plans}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{name}}}</option>
{{/plans}}
</select>
{{/singlePlan}}
<h3 class="mt-1">{{#str}}locatecompetency, tool_lp{{/str}}</h3>
<form data-region="filtercompetencies" data-planid="{{plan.id}}" class="d-flex flex-wrap align-items-center">
<div class="mb-3 d-flex">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input type="text" class="form-control" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
<button class="btn btn-secondary ml-1">{{#pix}}a/search, ,{{#str}}search{{/str}}{{/pix}}</button>
</div>
</form>
<ul data-enhance="linktree" style="display: none;" class="mt-1 competency-tree">
<li><span>{{{plan.name}}}</span>
<ul>
{{#competencies}}
{{> tool_lp/competencies_tree }}
{{/competencies}}
</ul>
</li>
</ul>
<div data-region="link-buttons" class="mt-1 float-sm-right">
<input type="button" class="btn btn-primary" data-action="add" value="{{#str}}add{{/str}}"/>
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
</div>
@@ -0,0 +1,55 @@
{{!
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/competency_plan_navigation
Show an auto-complete for jumping to competencies in a plan.
Context variables required for this template:
* hascompetencies - boolean
* competencies - array of competencies
* id
* shortname
* idnumber
* selected
* userid
* competencyid
* planid
// No example context because the JS is connected to webservices
}}
<div class="float-sm-right border p-2 mb-2">
{{#hascompetencies}}
<span>
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
<select class="custom-select" id="competency-nav-{{uniqid}}">
{{#competencies}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} {{idnumber}}</option>
{{/competencies}}
</select>
</span>
{{/hascompetencies}}
</div>
{{#js}}
require(['core/form-autocomplete', 'tool_lp/competency_plan_navigation'], function(autocomplete, nav) {
(new nav('#competency-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{competencyid}}, {{planid}}));
{{#hascompetencies}}
autocomplete.enhance('#competency-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptocompetency, tool_lp{{/ str }}{{/ quote }});
{{/hascompetencies}}
});
{{/js}}
@@ -0,0 +1,91 @@
{{!
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/competency_rule_config
Configuration dialogue for competency rules.
Context variables required for this template:
* config - boolean
* outcomes - array
* code
* name
* selected
* rules - array
* type
* name
* selected
Example context (json):
{
"config": true,
"outcomes": [
{
"code": "C1",
"name": "Complete",
"selected": true
}
],
"rules": [
{
"type": "Type",
"name": "Something happens",
"selected": true
}
]
}
}}
<div data-region="competencyruleconfig">
<div data-region="content">
{{^config}}
<p>{{#str}}cannotaddrules, tool_lp{{/str}}</p>
{{/config}}
{{#config}}
<div data-region="rule-base" class="form">
<div data-region="rule-outcome" class="mb-3">
<label>{{#str}}outcome, tool_lp{{/str}}</label>
<select name="outcome" class="custom-select">
{{#outcomes}}
<option value="{{code}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/outcomes}}
</select>
</div>
<div data-region="rule-type" class="mb-3">
<label>{{#str}}when, tool_lp{{/str}}</label>
<select name="rule" class="custom-select">
<option value="-1">{{#str}}choosedots{{/str}}</option>
{{#rules}}
<option value="{{type}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/rules}}
</select>
</div>
</div>
<div data-region="rule-config">
</div>
{{/config}}
</div>
<div data-region="footer" class="float-sm-right mt-1">
{{#config}}
<input type="button" class="btn btn-primary" data-action="save" value="{{#str}}savechanges{{/str}}"/>
{{/config}}
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
</div>
@@ -0,0 +1,73 @@
{{!
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/competency_rule_points
Configuration dialogue for competency points rule.
Context variables required for this template:
* children
* id
* shortname
* points
* requiredpoints
Example context (json):
{
"children": [
{
"id": "1",
"shortname": "Competency",
"points": 2
}
],
"requiredpoints": 4
}
}}
<div class="competency-rule-points">
<table class="table table-condensed">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">{{#str}}points, tool_lp{{/str}}</th>
<th scope="col">{{#str}}required{{/str}}</th>
</tr>
</thead>
<tbody>
{{#children}}
<tr data-competency="{{id}}">
<th scope="row">{{{shortname}}}</th>
<td>
<label class="accesshide" for="pointsforcompetency-{{id}}">{{#str}}pointsgivenfor, tool_lp, {{{competency.shortname}}}{{/str}}</label>
<input id="pointsforcompetency-{{id}}" type="number" min="0" value="{{points}}" name="points" class="form-control"/>
</td>
<td>
<label class="accesshide" for="competency-{{id}}-isrequired">{{#str}}aisrequired, tool_lp, {{{competency.shortname}}}{{/str}}</label>
<input id="competency-{{id}}-isrequired" type="checkbox" value="1" name="required" {{#required}}checked{{/required}} />
</td>
</tr>
{{/children}}
</tbody>
<tfoot>
<tr>
<th scope="row">{{#str}}totalrequiredtocomplete, tool_lp{{/str}}</th>
<td><input type="number" min="1" value="{{requiredpoints}}" name="requiredpoints" aria-label="{{#str}}totalrequiredtocomplete, tool_lp{{/str}}" class="form-control"></td>
<td> </td>
</tr>
</tfoot>
</table>
</div>
@@ -0,0 +1,88 @@
{{!
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/competency_summary
Summary of a competency
Context variables required for this template:
* competency
* id
* shortname
* idnumber
* description
* framework
* shortname
* comppath array of ancestors
* showrelatedcompetencies boolean
* related
* showrule boolean
* rule
* outcome
* type
Example context (json):
{
"competency": {
"id": 1,
"shortname": "C1",
"idnumber": "PATH",
"description": "Can do something"
},
"framework": {
"shortname": "F1"
}
}
}}
<div class='competency-heading'>
<h4 id="competency_link_{{competency.id}}">{{{competency.shortname}}}
<small>
{{#showlinks}}
<a href="{{pluginbaseurl}}/competencies.php?competencyid={{competency.id}}">{{competency.idnumber}}</a>
{{/showlinks}}
{{^showlinks}}
{{competency.idnumber}}
{{/showlinks}}
</small>
</h4>
{{#framework}}
<div class='competency-origin'>
<p><small>{{{framework.shortname}}} - {{taxonomyterm}}</small>
</div>
{{/framework}}
</div>
{{#competency.description}}
<p>{{{competency.description}}}</p>
{{/competency.description}}
{{#comppath}}
<span class="float-left">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
{{/comppath}}
{{#showrelatedcompetencies}}
{{> tool_lp/related_competencies }}
{{/showrelatedcompetencies}}
{{#showrule}}
<h5>{{#str}}competencyrule, tool_lp{{/str}}</h5>
<dl>
<dt>{{#str}}outcome, tool_lp{{/str}}</dt>
<dd>{{rule.outcome}}</dd>
<dt>{{#str}}when, tool_lp{{/str}}</dt>
<dd>{{rule.type}}</dd>
</dl>
{{/showrule}}
@@ -0,0 +1,159 @@
{{!
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/course_competencies_page
Course competencies template.
For a full list of the context for this template see the course_competencies_page renderable.
This template includes ajax functionality, so it cannot be shown in the template library.
}}
<div data-region="coursecompetenciespage">
<div data-region="actions" class="clearfix">
<div class="float-sm-left">
{{#canmanagecoursecompetencies}}
<button class="btn btn-secondary" disabled>{{#str}}addcoursecompetencies, tool_lp{{/str}}</button>
{{/canmanagecoursecompetencies}}
</div>
</div>
<div data-region="configurecoursecompetencies">
{{#cangradecompetencies}}
<p class="alert {{^settings.pushratingstouserplans}}alert-info{{/settings.pushratingstouserplans}}">
{{#settings.pushratingstouserplans}}
{{#str}}coursecompetencyratingsarepushedtouserplans, tool_lp{{/str}}
{{/settings.pushratingstouserplans}}
{{^settings.pushratingstouserplans}}
{{#str}}coursecompetencyratingsarenotpushedtouserplans, tool_lp{{/str}}
{{/settings.pushratingstouserplans}}
{{#canconfigurecoursecompetencies}}
<a href="#"
data-action="configure-course-competency-settings"
data-courseid="{{courseid}}"
data-pushratingstouserplans="{{settings.pushratingstouserplans}}">
{{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}
</a>
{{/canconfigurecoursecompetencies}}
</p>
{{/cangradecompetencies}}
</div>
{{#statistics}}
{{> tool_lp/course_competency_statistics }}
{{/statistics}}
<div data-region="coursecompetencies">
<table class="generaltable fullwidth managecompetencies">
<tbody class="drag-parentnode">
{{#competencies}}
<tr class="drag-samenode" data-id="{{competency.id}}">
<td>
{{#canmanagecoursecompetencies}}
<span class="drag-handlecontainer float-sm-left"></span>
<div class="float-sm-right">
<a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">
{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}
</a>
</div>
<div class="clearfix"></div>
{{/canmanagecoursecompetencies}}
{{#competency}}
<a href="{{pluginbaseurl}}/user_competency_in_course.php?courseid={{courseid}}&competencyid={{competency.id}}&userid={{gradableuserid}}"
id="competency-info-link-{{competency.id}}"
title="{{#str}}viewdetails, tool_lp{{/str}}">
<p><strong>{{{competency.shortname}}} <em>{{competency.idnumber}}</em></strong></p>
</a>
<p>{{{competency.description}}}</p>
{{/competency}}
{{#comppath}}
<span class="float-sm-left">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
{{/comppath}}
{{#usercompetencycourse}}
{{#grade}}
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white">{{gradename}}</span>
{{/grade}}
{{/usercompetencycourse}}
{{#canmanagecoursecompetencies}}
<div data-region="coursecompetency-ruleoutcome">
<label>
{{#str}}uponcoursecompletion, tool_lp{{/str}}
<select data-field="ruleoutcome" data-id="{{coursecompetency.id}}" class="custom-select">
{{#ruleoutcomeoptions}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{text}}</option>
{{/ruleoutcomeoptions}}
</select>
</label>
</div>
{{/canmanagecoursecompetencies}}
<div data-region="coursecompetencyactivities">
<p>
<strong>{{#str}}activities{{/str}}</strong>
<ul class="inline list-inline p-2">
{{#coursemodules}}
<li class="list-inline-item"><a href="{{url}}"><img class="icon" src="{{iconurl}}"> {{name}} </a></li>
{{/coursemodules}}
{{^coursemodules}}
<li class="list-inline-item">{{#str}}noactivities, tool_lp{{/str}}</li>
{{/coursemodules}}
</ul>
</p>
</div>
<div data-region="learningplans">
<p>
<strong>{{#str}}userplans, core_competency{{/str}}</strong>
<ul class="inline list-inline p-2">
{{#plans}}
<li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
{{/plans}}
{{^plans}}
<li class="list-inline-item">{{#str}}nouserplanswithcompetency, core_competency{{/str}}</li>
{{/plans}}
</ul>
</p>
</div>
</td>
</tr>
{{/competencies}}
</tbody>
</table>
{{^competencies}}
<p class="alert alert-info">
{{#moduleid}}
{{#str}}nocompetenciesinactivity, tool_lp{{/str}}
{{/moduleid}}
{{^moduleid}}
{{#str}}nocompetenciesincourse, tool_lp{{/str}}
{{/moduleid}}
</p>
{{/competencies}}
</div>
<div data-region="actions">
{{#canmanagecompetencyframeworks}}
<p><a href="{{manageurl}}">{{#str}}managecompetenciesandframeworks, tool_lp{{/str}}</a></p>
{{/canmanagecompetencyframeworks}}
</div>
</div>
{{#js}}
require(['tool_lp/competencies'], function(mod) {
(new mod({{courseid}}, 'course', {{pagecontextid}}));
});
{{/js}}
{{#canconfigurecoursecompetencies}}
{{#js}}
require(['tool_lp/course_competency_settings'], function(Mod) {
(new Mod('[data-action=configure-course-competency-settings]'));
});
{{/js}}
{{/canconfigurecoursecompetencies}}
@@ -0,0 +1,57 @@
{{!
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/course_competency_settings
Select an action to execute.
Classes required for JS:
* none
Data attibutes required for JS:
* none
Context variables required for this template:
* courseid
* pushratingstouserplans
Example context (json):
{
"pushratingstouserplans": false,
"courseid": -1
}
}}
<form data-region="coursecompetencysettings">
<input type="hidden" name="courseid" value="{{courseid}}"/>
<fieldset>
<p>{{#str}}coursecompetencyratingsquestion, tool_lp{{/str}}</p>
<label><input type="radio" value="0" name="pushratingstouserplans"
{{^settings.pushratingstouserplans}}checked{{/settings.pushratingstouserplans}}>
{{#str}}ratingaffectsonlycourse, tool_lp{{/str}}
</label>
<label><input type="radio" value="1" name="pushratingstouserplans"
{{#settings.pushratingstouserplans}}checked{{/settings.pushratingstouserplans}}>
{{#str}}ratingaffectsuserplans, tool_lp{{/str}}
</label>
</fieldset>
<fieldset class="float-sm-right">
<input type="button" class="btn btn-primary" data-action="save" value="{{#str}}savechanges{{/str}}"/>
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</fieldset>
<div class="clearfix"></div>
</form>
@@ -0,0 +1,79 @@
{{!
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/course_competency_statistics
IDs required for JS:
* none
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
See competency/classes/external/course_competency_statistics_exporter
Example context (json):
{
"competencycount": 4,
"canbegradedincourse": true,
"canmanagecoursecompetencies": true,
"proficientcompetencycount": 3,
"proficientcompetencypercentage": 75,
"proficientcompetencypercentageformatted": 75.0,
"leastproficientcount": 1,
"leastproficient": [
{ "id": 1, "shortname": "Comp 1", "idnumber": "C1" }
]
}
}}
{{!
Template statistics template.
}}
{{#competencycount}}
<div data-region="coursecompetencystatistics" class="border p-2 mb-2">
{{#canbegradedincourse}}
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}xcompetenciesproficientoutofyincourse, tool_lp, { "x": "{{proficientcompetencycount}}", "y": "{{competencycount}}" } {{/str}}
{{/progresstext}}
{{$percentage}}{{proficientcompetencypercentage}}{{/percentage}}
{{$percentlabel}}{{proficientcompetencypercentageformatted}}&nbsp;%{{/percentlabel}}
{{/tool_lp/progress_bar}}
{{/canbegradedincourse}}
{{#canmanagecoursecompetencies}}
{{#leastproficientcount}}
<div>
<div>
<p>{{#str}}competenciesmostoftennotproficientincourse, tool_lp{{/str}}</p>
</div>
<div>
{{#leastproficient}}
<a href="#competency-info-link-{{id}}">
<div><p>{{{shortname}}} <em>{{idnumber}}</em></p></div>
</a>
{{/leastproficient}}
</div>
</div>
{{/leastproficientcount}}
{{/canmanagecoursecompetencies}}
</div>
{{/competencycount}}
@@ -0,0 +1,75 @@
{{!
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/evidence_summary
Moodle template for the the summary of a single piece of evidence.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* actionuser User record from a user_summary_exporter
* userdate User formatted date this evidence was created
* grade Raw grade value if set
* gradename Scale grade item
* description Description of the evidence
* url Optional url for the evidence
Example context (json):
{ "actionuser": { "id": 1, "fullname": "Legend", "profileimageurlsmall": "https://secure.gravatar.com/avatar/78f83716ad197a25e175fbb747cff1ff?s=35&d=mm" },
"userdate": "Tuesday...",
"grade": 2,
"gradename": "Met",
"description": "The user competency was manually rated in the plan Personal plan A",
"url": "http://moodle.org/",
"candelete": true,
"id": 1
}
}}
<div class="border p-2 mb-2 evidence" data-region="evidence" data-id="{{id}}">
{{#candelete}}
<div class="float-sm-right">
<a href="#" data-action="delete-evidence">{{#pix}}t/delete{{/pix}}</a>
</div>
{{/candelete}}
{{#actionuser}}
<div>
{{> tool_lp/user_summary }}
</div>
{{/actionuser}}
<strong><time datetime="{{userdate}}">{{userdate}}</time></strong>
{{#grade}}
<p><span class="badge bg-info text-white">{{gradename}}</span></p>
{{/grade}}
<p>{{description}}</p>
{{#note}}
<blockquote>{{note}}</blockquote>
{{/note}}
{{#url}}
<p><a href="{{url}}" target="_blank" rel="noreferrer">{{url}}</a></p>
{{/url}}
</div>
{{#js}}
require(['tool_lp/evidence_delete'], function(EvidenceDelete) {
EvidenceDelete.register('[data-action="delete-evidence"]', '[data-region="evidence"]');
});
{{/js}}
@@ -0,0 +1,57 @@
{{!
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/form-user-selector-suggestion
Moodle template for the list of valid options in an autocomplate form element.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* profileimageurlsmall Url to a small profile image.
* profileimageurl Url to a profile image.
* fullname Users full name
* hasidentity boolean to say if there are identity fields to show
* identity concatenated list of identity fields.
* id user id field
* email user email field
* idnumber user idnumber field
* phone1 user phone1 field
* phone2 user phone2 field
* department user department field
* institution user institution field
Example context (json):
{ "id": "1",
"fullname": "Admin",
"hasidentity": true,
"identity": "Admin User, 0144114141",
"profileimageurl": "invalid url",
"profileimageurlsmall": "invalid url"
}
}}
<span>
<img height="12" src="{{profileimageurlsmall}}" alt="">
<span>{{fullname}}</span>
{{#hasidentity}}
<span><small>{{identity}}</small></span>
{{/hasidentity}}
</span>
@@ -0,0 +1,70 @@
{{!
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/form_competency_list
List of competencies for a form element.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* competencies array
* id int
* shortname string
* idnumber string
Example context (json):
{
"competencies":
[
{
"id": 1,
"shortname": "Competency",
"idnumber": "C1"
}
]
}
}}
<div data-region="competencies">
<ul>
{{#competencies}}
<li>
<div class="float-right">
<a href="#" data-action="deselect-competency" data-id="{{id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
</div>
<p>
<a href="#" data-action="competency-dialogue" data-id="{{id}}">
{{{shortname}}}{{#idnumber}} {{idnumber}}{{/idnumber}}
</a>
</p>
</li>
{{/competencies}}
</ul>
{{^competencies}}
{{#str}}nocompetenciesinlist, tool_lp{{/str}}
{{/competencies}}
</div>
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
Compdialogue.init();
});
{{/js}}
@@ -0,0 +1,56 @@
{{!
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/linked_courses_summary
Moodle template for the list of linked courses to a competency
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* courses array
* viewurl
* fullname
* shortname
Example context (json):
{ "courses":
[
{
"viewurl": "http://example.com",
"fullname": "Course 1",
"shortname": "C1"
}
]
}
}}
<p>
{{#str}}coursesusingthiscompetency, tool_lp{{/str}}
</p>
<ol>
{{#courses}}
<li><a href="{{viewurl}}">{{{fullname}}} {{{shortname}}}</a></li>
{{/courses}}
{{^courses}}
{{#str}}nolinkedcourses, tool_lp{{/str}}
{{/courses}}
</ol>
+29
View File
@@ -0,0 +1,29 @@
{{!
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/>.
}}
{{!
Manage learning plan templates template.
Classes required for JS:
* None
Data attibutes required for JS:
* None
Context variables required for this template:
* None
}}
{{#pix}}y/loading, core, {{#str}}loading, tool_lp{{/str}}{{/pix}}
@@ -0,0 +1,154 @@
{{!
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/manage_competencies_page
Manage competencies template.
Classes required for JS:
Data attibutes required for JS:
* data-action=add
* data-enhance=tree
* data-region=term
* data-region=selected-competency
Example context (json):
{
"framework": {
"description": "Framework",
"id": 0
},
"competencies": [],
"canmanage": false
}
}}
<div data-region="managecompetencies">
<h2>
{{{framework.shortname}}}
{{#canmanage}}
<a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{framework.id}}&pagecontextid={{pagecontextid}}&return=competencies">{{#pix}}t/edit, core, {{#str}}editcompetencyframework, tool_lp{{/str}}{{/pix}}</a>
{{/canmanage}}
</h2>
<div>{{{framework.description}}}</div>
<h3>{{#str}}competencies, core_competency{{/str}}</h3>
<div class="row">
<div class="col-lg-6">
<p>
<form data-region="filtercompetencies" data-frameworkid="{{framework.id}}" class="d-flex flex-wrap align-items-center">
<div class="input-group mb-3">
<label class="accesshide" for="filter{{uniqid}}">{{#str}}search, tool_lp{{/str}}</label>
<input class="form-control" type="text" id="filter{{uniqid}}" placeholder="{{#str}}search, tool_lp{{/str}}" value="{{search}}">
<div class="input-group-append">
<button class="btn btn-secondary">{{#pix}}a/search, , {{#str}}search{{/str}}{{/pix}}</button>
</div>
</div>
</form>
</p>
<ul data-enhance="tree" class="competency-tree">
{{> tool_lp/loading }}
</ul>
</div>
<div class="col-lg-6">
<div class="border p-2 mb-2">
<div class="card-title">
<h4 data-region="selected-competency">{{#str}}selectedcompetency, tool_lp{{/str}}</h4>
<span data-region="competencyactionsmenu" class="float-sm-right">
<ul title="{{#str}}edit{{/str}}" class="competencyactionsmenu">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
{{#canmanage}}
<li class="dropdown-item">
<a href="#" data-action="edit">
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="#" data-action="move">
{{#pix}}t/move{{/pix}} {{#str}}movetonewparent, tool_lp{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="#" data-action="delete">
{{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="#" data-action="moveup">
{{#pix}}t/up{{/pix}} {{#str}}moveup{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="#" data-action="movedown">
{{#pix}}t/down{{/pix}} {{#str}}movedown{{/str}}
</a>
</li>
{{/canmanage}}
<li class="dropdown-item">
<a href="#" data-action="linkedcourses">
{{#pix}}t/viewdetails{{/pix}} {{#str}}linkedcourses, tool_lp{{/str}}
</a>
</li>
{{#canmanage}}
<li class="dropdown-item">
<a href="#" data-action="relatedcompetencies">
{{#pix}}t/add{{/pix}} {{#str}}addcrossreferencedcompetency, tool_lp{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="#" data-action="competencyrules">
{{#pix}}t/edit{{/pix}} {{#str}}competencyrule, tool_lp{{/str}}
</a>
</li>
{{/canmanage}}
</ul>
</li>
</ul>
</span>
</div>
<p data-region="competencyinfo">
{{#str}}nocompetencyselected, tool_lp{{/str}}
</p>
<div data-region="competencyactions">
{{#canmanage}}
<button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} <span data-region="term"></span></button>
{{/canmanage}}
</div>
</div>
</div>
</div>
</div>
{{#js}}
// Initialise the JS.
require(['tool_lp/tree', 'tool_lp/competencytree', 'tool_lp/competencyactions', 'jquery'],
function(ariatree, treeModel, actions, $) {
treeModel.init({{framework.id}},
{{#quote}} {{{framework.shortname}}} {{/quote}},
'{{search}}',
'[data-enhance=tree]',
{{canmanage}},
{{competencyid}});
actions.init(treeModel, {{pagecontextid}}, '{{{framework.taxonomies}}}', {{{rulesmodules}}});
});
{{/js}}
@@ -0,0 +1,110 @@
{{!
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/>.
}}
{{!
Manage competency frameworks template.
Classes required for JS:
* drag-parentnode
* drag-handlecontainer
* drag-samenode
* competencyframeworkactions
Data attributes required for JS:
* data-region = managecompetencies
* data-frameworkid = id
* data-action = deletecompetencyframework
Context variables required for this template:
* competencyframeworks - array of objects containing id, shortname, idnumber, visible
* canmanage - true if this user has permission to manage the frameworks
* navigation - array of strings containing buttons for navigation
}}
<div data-region="managecompetencies">
<div class="float-left">
{{#navigation}}
{{{.}}}
{{/navigation}}
</div>
<table class="generaltable fullwidth managecompetencies">
<caption>{{#str}}listcompetencyframeworkscaption, tool_lp{{/str}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}competencyframeworkname, tool_lp{{/str}}</th>
<th scope="col">{{#str}}competencies, core_competency{{/str}}</th>
<th scope="col">{{#str}}category, tool_lp{{/str}}</th>
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
</tr>
</thead>
<tbody class="drag-parentnode">
{{#competencyframeworks}}
<tr class="drag-samenode" data-frameworkid="{{id}}">
<td><span class="drag-handlecontainer"></span><span><a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{id}}&amp;pagecontextid={{pagecontextid}}">{{{shortname}}} ({{idnumber}})</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
<td>{{competenciescount}}</td>
<td>{{contextnamenoprefix}}</td>
<td>
{{#canmanage}}
<ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
<li class="dropdown-item">
<a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
</a>
</li>
<li class="dropdown-item">
<a data-action="duplicatecompetencyframework" href="#" data-frameworkid="{{id}}">
{{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
</a>
</li>
<li class="dropdown-item">
<a data-action="deletecompetencyframework" href="#" data-frameworkid="{{id}}">
{{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
</a>
</li>
</ul>
</li>
</ul>
{{/canmanage}}
</td>
</tr>
{{/competencyframeworks}}
</tbody>
</table>
{{^competencyframeworks}}
<p class="alert alert-info">
{{#str}}nocompetencyframeworks, tool_lp{{/str}}
</p>
{{/competencyframeworks}}
{{#js}}
// Initialise the JS.
require(['tool_lp/frameworkactions',
'tool_lp/menubar'],
function(actionsMod, menubar) {
actionsMod.init({{pagecontextid}});
menubar.enhance('.competencyframeworkactions', {
"[data-action='deletecompetencyframework']": actionsMod.deleteHandler,
"[data-action='duplicatecompetencyframework']": actionsMod.duplicateHandler,
});
});
{{/js}}
</div>
@@ -0,0 +1,122 @@
{{!
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/>.
}}
{{!
Manage learning plan templates template.
Classes required for JS:
* drag-parentnode
* drag-samenode
* templateactions
Data attibutes required for JS:
* data-region = managetemplates
* data-templateid = id
* data-action = deletetemplate
Context variables required for this template:
* templates - array of objects containing id, shortname, visible, canmanage, contextname
* navigation - array of strings containing buttons for navigation
}}
<div data-region="managetemplates">
<div class="float-left">
{{#navigation}}
{{{.}}}
{{/navigation}}
</div>
<table class="generaltable fullwidth managetemplates">
<caption>{{#str}}listtemplatescaption, tool_lp{{/str}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}templatename, tool_lp{{/str}}</th>
<th scope="col">{{#str}}category, tool_lp{{/str}}</th>
<th scope="col">{{#str}}cohorts, core_cohort{{/str}}</th>
<th scope="col">{{#str}}userplans, core_competency{{/str}}</th>
{{#canmanage}}
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
{{/canmanage}}
</tr>
</thead>
<tbody class="drag-parentnode">
{{#templates}}
<tr class="drag-samenode" data-templateid="{{id}}">
<td><a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&amp;pagecontextid={{pagecontextid}}">{{{shortname}}}</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
<td>{{contextnamenoprefix}}</td>
<td><a class="template-cohorts" href="{{pluginbaseurl}}/template_cohorts.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">{{cohortscount}}</a></td>
<td><a class="template-userplans" href="{{pluginbaseurl}}/template_plans.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">{{planscount}}</a></td>
<td>
{{#canmanage}}
<ul class="templateactions">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
<li class="dropdown-item">
<a href="{{pluginbaseurl}}/edittemplate.php?id={{id}}&amp;pagecontextid={{pagecontextid}}&amp;return=templates">
{{#pix}}t/edit{{/pix}} {{#str}}edit{{/str}}
</a>
</li>
<li class="dropdown-item">
<a data-action="duplicatetemplate" data-templateid="{{id}}" href="#">
{{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="{{pluginbaseurl}}/template_plans.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">
{{#pix}}t/add{{/pix}} {{#str}}createlearningplans, tool_lp{{/str}}
</a>
</li>
<li class="dropdown-item">
<a href="{{pluginbaseurl}}/template_cohorts.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">
{{#pix}}t/add{{/pix}} {{#str}}addcohortstosync, tool_lp{{/str}}
</a>
</li>
<li class="dropdown-item">
<a data-action="deletetemplate" data-templateid="{{id}}" href="#">
{{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
</a>
</li>
</ul>
</li>
</ul>
{{/canmanage}}
</td>
</tr>
{{/templates}}
</tbody>
</table>
{{^templates}}
<p class="alert alert-info">
{{#str}}notemplates, tool_lp{{/str}}
</p>
{{/templates}}
{{#js}}
// Initialise the JS.
require(['tool_lp/templateactions',
'tool_lp/menubar'],
function(actionsMod, menubar) {
actionsMod.init({{pagecontextid}});
menubar.enhance('.templateactions', {
'[data-action="deletetemplate"]': actionsMod.deleteHandler,
'[data-action="duplicatetemplate"]': actionsMod.duplicateHandler
});
});
{{/js}}
</div>
@@ -0,0 +1,54 @@
{{!
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/module_navigation
Show an auto-complete for filtering by competencies linked to a module.
Context variables required for this template:
* hasmodules
* modules - array
* id
* selected
* name
// No example context because the JS is connected to webservices
}}
<div class="float-right border mb-2 p-2">
<form class="user-competency-course-navigation">
<input type="hidden" name="courseid" value="{{courseid}}"/>
<input type="hidden" name="mod" value="{{moduleid}}"/>
{{#hasmodules}}
<span>
<label for="module-nav-{{uniqid}}" class="accesshide">{{#str}}filterbyactivity, tool_lp{{/str}}</label>
<select id="module-nav-{{uniqid}}">
{{#modules}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{name}}</option>
{{/modules}}
</select>
</span>
{{/hasmodules}}
</form>
</div>
{{#js}}
require(['core/form-autocomplete', 'tool_lp/module_navigation'], function(autocomplete, nav) {
(new nav('#module-nav-{{uniqid}}', '{{baseurl}}', {{courseid}}, {{moduleid}}));
{{#hasmodules}}
autocomplete.enhance('#module-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}filterbyactivity, tool_lp{{/ str }}{{/ quote }});
{{/hasmodules}}
});
{{/js}}
@@ -0,0 +1,33 @@
{{!
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/no_frameworks_warning
No frameworks warning template.
Classes required for JS:
None
Context variables required for this template:
None
Example context (json):
{
}
}}
<p class="alert alert-danger">
{{#str}}nocompetencyframeworks, tool_lp{{/str}}
</p>
+204
View File
@@ -0,0 +1,204 @@
{{!
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/>.
}}
{{!
Plan page template.
}}
<div data-region="plan-page" data-id="{{plan.id}}" data-userid="{{plan.userid}}">
<h2>
{{{plan.name}}}
{{#plan.canbeedited}}
<a href="{{pluginbaseurl}}/editplan.php?id={{plan.id}}&amp;userid={{plan.userid}}">{{#pix}}t/edit, core, {{#str}}editplan, tool_lp{{/str}}{{/pix}}</a>
{{/plan.canbeedited}}
</h2>
{{#plan.canbeedited}}
<div data-region="actions" class="clearfix">
<div class="float-left">
<!-- Button to add competencies to the plan -->
<button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} {{#str}}addcompetency, tool_lp{{/str}}</button>
</div>
</div>
{{/plan.canbeedited}}
<div data-region="plan-summary" class="mt-1">
{{{plan.description}}}
<dl>
<dt>{{#str}}status, tool_lp{{/str}}</dt>
<dd>
{{plan.statusname}}
{{#plan.isinreview}}
- {{plan.reviewer.fullname}}
{{/plan.isinreview}}
{{#plan.iscompleteallowed}}
(<a data-action="plan-complete" href="#">{{#str}}completeplan, tool_lp{{/str}}</a>)
{{/plan.iscompleteallowed}}
{{#plan.isreopenallowed}}
(<a data-action="plan-reopen" href="#">{{#str}}reopenplan, tool_lp{{/str}}</a>)
{{/plan.isreopenallowed}}
{{#plan.isrequestreviewallowed}}
(<a data-action="plan-request-review" href="#">{{#str}}requestreview, tool_lp{{/str}}</a>)
{{/plan.isrequestreviewallowed}}
{{#plan.iscancelreviewrequestallowed}}
(<a data-action="plan-cancel-review-request" href="#">{{#str}}cancelreviewrequest, tool_lp{{/str}}</a>)
{{/plan.iscancelreviewrequestallowed}}
{{#plan.isstartreviewallowed}}
(<a data-action="plan-start-review" href="#">{{#str}}startreview, tool_lp{{/str}}</a>)
{{/plan.isstartreviewallowed}}
{{#plan.isstopreviewallowed}}
(<a data-action="plan-stop-review" href="#">{{#str}}stopreview, tool_lp{{/str}}</a>)
{{/plan.isstopreviewallowed}}
{{#plan.isapproveallowed}}
(<a data-action="plan-approve" href="#">{{#str}}planapprove, tool_lp{{/str}}</a>)
{{/plan.isapproveallowed}}
{{#plan.isunapproveallowed}}
(<a data-action="plan-unapprove" href="#">{{#str}}planunapprove, tool_lp{{/str}}</a>)
{{/plan.isunapproveallowed}}
</dd>
{{#plan.duedate}}
<dt>{{#str}}duedate, tool_lp{{/str}}</dt>
<dd>{{plan.duedateformatted}}</dd>
{{/plan.duedate}}
{{#plan.template}}
<dt>{{#str}}template, tool_lp{{/str}}</dt>
<dd>
{{#canread}}
<a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&amp;pagecontextid={{contextid}}">
{{/canread}}
{{{plan.template.shortname}}}{{#canread}}</a>{{/canread}}
{{#plan.isunlinkallowed}}
(<a data-action="plan-unlink" href="#">{{#str}}unlinkplantemplate, tool_lp{{/str}}</a>)
{{/plan.isunlinkallowed}}
</dd>
{{/plan.template}}
{{#description}}
<dt>{{#str}}description{{/str}}</dt>
<dd>{{{plan.description}}}</dd>
{{/description}}
<dt>{{#str}}progress, tool_lp{{/str}}</dt>
<dd>
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}xcompetenciesproficientoutofy, tool_lp, { "x": "{{proficientcompetencycount}}", "y": "{{competencycount}}" }{{/str}}
{{/progresstext}}
{{$percentage}}{{proficientcompetencypercentage}}{{/percentage}}
{{$percentlabel}}{{proficientcompetencypercentageformatted}}&nbsp;%{{/percentlabel}}
{{/tool_lp/progress_bar}}
</dd>
</dl>
</div>
{{#plan.commentarea}}
{{#canpostorhascomments}}
<div data-region="comments" class="mt-1">
{{>tool_lp/comment_area}}
</div>
{{/canpostorhascomments}}
{{/plan.commentarea}}
<div data-region="plan-competencies" class="mt-1">
<h3>{{#str}}learningplancompetencies, tool_lp{{/str}}</h3>
<table class="generaltable fullwidth managecompetencies">
<thead>
<tr>
<th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
<th scope="col">{{#str}}rating, tool_lp{{/str}}</th>
<th scope="col">{{#str}}proficient, tool_lp{{/str}}</th>
{{^plan.iscompleted}}
<th scope="col">{{#str}}status, tool_lp{{/str}}</th>
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
{{/plan.iscompleted}}
</tr>
</thead>
<tbody class="drag-parentnode">
{{#competencies}}
<tr class="drag-samenode" data-node="user-competency" data-id="{{competency.id}}"
data-competencyid="{{competency.id}}"
data-userid="{{plan.userid}}">
<td>
{{#plan.canbeedited}}
<span class="drag-handlecontainer float-left"></span>
{{/plan.canbeedited}}
<a data-usercompetency="true" href="#">{{{competency.shortname}}}</a>
<em>{{competency.idnumber}}</em>
{{#comppath}}
<br>
<span class="float-left">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
{{/comppath}}
</td>
{{#plan.iscompleted}}
<td>{{usercompetencyplan.gradename}}</td>
<td>{{usercompetencyplan.proficiencyname}}</td>
{{/plan.iscompleted}}
{{^plan.iscompleted}}
<td>{{usercompetency.gradename}}</td>
<td>{{usercompetency.proficiencyname}}</td>
<td>{{usercompetency.statusname}}</td>
{{/plan.iscompleted}}
{{^plan.iscompleted}}
<td>
<ul title="{{#str}}edit{{/str}}" class="user-competency-actions">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
{{#usercompetency.isrequestreviewallowed}}
<li class="dropdown-item">
<a href="#" data-action="request-review">{{#pix}}t/edit, core{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
</li>
{{/usercompetency.isrequestreviewallowed}}
{{#usercompetency.iscancelreviewrequestallowed}}
<li class="dropdown-item">
<a href="#" data-action="cancel-review-request">{{#pix}}t/edit, core{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
</li>
{{/usercompetency.iscancelreviewrequestallowed}}
{{#plan.canbeedited}}
<li class="dropdown-item">
<a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core{{/pix}} {{#str}}delete{{/str}}</a>
</li>
{{/plan.canbeedited}}
<li class="dropdown-item">
<a href="#" data-action="find-courses-link" data-id="{{competency.id}}">{{#pix}}t/preview, core{{/pix}} {{#str}}findcourses, tool_lp{{/str}}</a>
</li>
</ul>
</li>
</ul>
</td>
{{/plan.iscompleted}}
</tr>
{{/competencies}}
</tbody>
</table>
{{^competencies}}
<p class="alert alert-info">
{{#str}}nocompetenciesinlearningplan, tool_lp{{/str}}
</p>
{{/competencies}}
</div>
</div>
{{#js}}
require(['tool_lp/competencies', 'tool_lp/planactions', 'tool_lp/user_competency_workflow', 'tool_lp/user_competency_plan_popup'], function(mod, actionsMod, UserCompWorkflow, Popup) {
var planActions = new actionsMod('plan');
(new mod({{plan.id}}, 'plan', {{contextid}}));
(new Popup('[data-region=plan-page]', '[data-usercompetency=true]', {{plan.id}}));
planActions.registerEvents();
var ucw = new UserCompWorkflow();
ucw.enhanceMenubar('.user-competency-actions');
ucw.on('status-changed', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
ucw.on('error-occured', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
});
{{/js}}
+174
View File
@@ -0,0 +1,174 @@
{{!
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/>.
}}
{{!
User learning plans page.
Classes required for JS:
* planactions
Data attributes required for JS:
* data-region = plans
* data-planid = plans.id
* data-userid = userid
* data-action = deleteplan
Context variables required for this template:
* userid - The plan user id
* pluginbaseurl - tool_lp base url
* plans - The list of learning plans
* navigation - array of strings containing buttons for navigation
}}
<div data-region="plans">
<div class="float-left">
{{#navigation}}
{{{.}}}
{{/navigation}}
</div>
<table class="generaltable fullwidth">
<caption>{{#str}}listplanscaption, tool_lp{{/str}}</caption>
<thead>
<tr>
<th scope="col">{{#str}}planname, tool_lp{{/str}}</th>
<th scope="col">{{#str}}templatebased, tool_lp{{/str}}</th>
<th scope="col">{{#str}}status, tool_lp{{/str}}</th>
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
</tr>
</thead>
<tbody>
{{#plans}}
<tr data-region="plan-node" data-id="{{id}}" data-userid="{{userid}}">
<td>
<span><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></span>
</td>
<td>
{{#isbasedontemplate}}
<span class="badge bg-info text-white">{{#str}}yes{{/str}}</span>
{{/isbasedontemplate}}
{{^isbasedontemplate}}
<span class="badge">{{#str}}no{{/str}}</span>
{{/isbasedontemplate}}
</td>
<td>{{statusname}}</td>
<td>
{{#canmanage}}
<div style="display: inline-block;">
<ul title="{{#str}}edit{{/str}}" class="planactions">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
<li class="{{^canbeedited}} disabled {{/canbeedited}} dropdown-item">
<a href="{{#canbeedited}}
{{pluginbaseurl}}/editplan.php?id={{id}}&amp;userid={{userid}}&amp;return=plans
{{/canbeedited}}
{{^canbeedited}}
#
{{/canbeedited}}
">
{{#pix}}t/edit{{/pix}} {{#str}}editthisplan, tool_lp{{/str}}
</a>
</li>
{{#isreopenallowed}}
<li class="dropdown-item">
<a data-action="plan-reopen" href="#">
{{#pix}}t/edit{{/pix}} {{#str}}reopenplan, tool_lp{{/str}}
</a>
</li>
{{/isreopenallowed}}
{{#iscompleteallowed}}
<li class="dropdown-item">
<a data-action="plan-complete" href="#">
{{#pix}}t/edit{{/pix}} {{#str}}completeplan, tool_lp{{/str}}
</a>
</li>
{{/iscompleteallowed}}
{{#isrequestreviewallowed}}
<li class="dropdown-item">
<a data-action="plan-request-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
</li>
{{/isrequestreviewallowed}}
{{#iscancelreviewrequestallowed}}
<li class="dropdown-item">
<a data-action="plan-cancel-review-request" href="#">{{#pix}}t/edit{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
</li>
{{/iscancelreviewrequestallowed}}
{{#isstartreviewallowed}}
<li class="dropdown-item">
<a data-action="plan-start-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}startreview, tool_lp{{/str}}</a>
</li>
{{/isstartreviewallowed}}
{{#isstopreviewallowed}}
<li class="dropdown-item">
<a data-action="plan-stop-review" href="#">{{#pix}}t/edit{{/pix}} {{#str}}stopreview, tool_lp{{/str}}</a>
</li>
{{/isstopreviewallowed}}
{{#isapproveallowed}}
<li class="dropdown-item">
<a data-action="plan-approve" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planapprove, tool_lp{{/str}}</a>
</li>
{{/isapproveallowed}}
{{#isunapproveallowed}}
<li class="dropdown-item">
<a data-action="plan-unapprove" href="#">{{#pix}}t/edit{{/pix}} {{#str}}planunapprove, tool_lp{{/str}}</a>
</li>
{{/isunapproveallowed}}
{{#isunlinkallowed}}
<li class="dropdown-item">
<a data-action="plan-unlink" href="#">
{{#pix}}t/edit{{/pix}} {{#str}}unlinkplantemplate, tool_lp{{/str}}
</a>
</li>
{{/isunlinkallowed}}
<li class="dropdown-item">
<a data-action="plan-delete" href="#">
{{#pix}}t/delete{{/pix}} {{#str}}deletethisplan, tool_lp{{/str}}
</a>
</li>
</ul>
</ul>
</div>
{{/canmanage}}
</td>
</tr>
{{/plans}}
</tbody>
</table>
{{^plans}}
<p class="alert alert-info">
{{#str}}nouserplans, tool_lp{{/str}}
</p>
{{/plans}}
{{#canreaduserevidence}}
<div class="float-left">
<a href="{{pluginbaseurl}}/user_evidence_list.php?userid={{userid}}">{{#str}}userevidence, tool_lp{{/str}}</a>
</div>
{{/canreaduserevidence}}
{{#js}}
// Initialise the JS.
require(['tool_lp/planactions'],
function(ActionsMod) {
var planActions = new ActionsMod('plans');
planActions.enhanceMenubar('.planactions');
});
{{/js}}
</div>
@@ -0,0 +1,47 @@
{{!
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/progress_bar
Moodle progress bar template for tool_lp.
The purpose of this template is to render a progress bar with a brief description.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* progresstextvalue A brief text that describes the progress bar.
* percentagevalue The numeric value for the progress bar's percentage.
* percentlabelvalue The progress bar's label that shows the percentage value.
Example context (json):
{
"progresstextvalue": "Progress:",
"percentagevalue": "50",
"percentlabelvalue": "50.00 %"
}
}}
<div id="progress-{{uniqid}}">
{{$progresstext}}{{progresstextvalue}}{{/progresstext}}
</div>
<progress class="progress" aria-describedby="progress-{{uniqid}}"
value="{{$percentage}}{{percentagevalue}}{{/percentage}}" max="100"></progress>
@@ -0,0 +1,77 @@
{{!
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/related_competencies
List of related competencies.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* showdeleterelatedaction boolean
* relatedcompetencies array
* id int
* shortname string
* idnumber string
Example context (json):
{
"showdeleterelatedaction": false,
"relatedcompetencies":
[
{
"id": 1,
"shortname": "Competency",
"idnumber": "C1"
}
]
}
}}
<div data-region="relatedcompetencies">
<p>
<strong>{{#str}}crossreferencedcompetencies, tool_lp{{/str}}:</strong>
</p>
<ul>
{{#relatedcompetencies}}
<li>
{{#showdeleterelatedaction}}
<div class="float-sm-right">
<a href="#" data-action="deleterelation" id="id-related-{{id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
</div>
{{/showdeleterelatedaction}}
<p>
<a href="#" data-action="competency-dialogue" data-id="{{id}}">
{{{shortname}}}{{#idnumber}} {{idnumber}}{{/idnumber}}
</a>
</p>
</li>
{{/relatedcompetencies}}
</ul>
{{^relatedcompetencies}}
{{#str}}nocrossreferencedcompetencies, tool_lp{{/str}}
{{/relatedcompetencies}}
</div>
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
Compdialogue.init();
});
{{/js}}
@@ -0,0 +1,65 @@
{{!
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/scale_configuration_page
Set scale configuration for the competency framework.
Classes required for JS:
* none
Data attibutes required for JS:
* data-field
Context variables required for this template:
* scales Array of id / name pairs.
Example context (json):
{
"scales": [
{ "id": 1, "name": "Competent" },
{ "id": 2, "name": "Not competent" }
]
}
}}
<div>
<table class="table table-condensed">
<thead>
<tr>
<th scope="col">{{#str}}scalevalue, tool_lp{{/str}}</th>
<th scope="col">{{#str}}default, tool_lp{{/str}}{{#pix }} req, core, {{#str}}requiredelement, form{{/str}} {{/pix }}</th>
<th scope="col">{{#str}}proficient, tool_lp{{/str}}{{#pix }} req, core, {{#str}}requiredelement, form{{/str}}{{/pix }}</th>
</tr>
</thead>
<tbody>
{{#scales}}
<tr class="tool_lp_scale_config">
<td>{{name}}</td>
<td><input type="radio" name="default_{{uniqid}}" data-field="tool_lp_scale_default_{{id}}" class="tool_lp_scale_default"/></td>
<td><input type="checkbox" name="proficient" data-field="tool_lp_scale_proficient_{{id}}"
class="tool_lp_scale_proficient"/></td>
</tr>
{{/scales}}
</tbody>
</table>
</div>
<div data-region="scale-buttons" class="mt-1 float-sm-right">
<input type="button" class="btn btn-secondary" data-action="close" value="{{#str}}closebuttontitle{{/str}}"/>
<input type="button" class="btn btn-secondary" data-action="cancel" value="{{#str}}cancel{{/str}}"/>
</div>
<div class="clearfix"></div>
@@ -0,0 +1,86 @@
{{!
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 competencies template.
}}
<div data-region="templatecompetenciespage">
<h2>
{{{template.shortname}}}
{{#template.canmanage}}
<a href="{{pluginbaseurl}}/edittemplate.php?id={{template.id}}&amp;pagecontextid={{pagecontextid}}">{{#pix}}t/edit, core, {{#str}}edittemplate, tool_lp{{/str}}{{/pix}}</a>
{{/template.canmanage}}
</h2>
<div>{{{template.description}}}</div>
{{#canmanagetemplatecompetencies}}
<div data-region="actions" class="my-4">
<button disabled class="btn btn-secondary">{{#str}}addtemplatecompetencies, tool_lp{{/str}}</button>
</div>
{{/canmanagetemplatecompetencies}}
<h3 class="mt-1">{{#str}}templatecompetencies, tool_lp{{/str}}</h3>
{{#statistics}}
{{> tool_lp/template_statistics }}
{{/statistics}}
<div data-region="templatecompetencies">
<div class="managecompetencies">
<div class="drag-parentnode">
{{#competencies}}
<div class="drag-samenode" data-id="{{competency.id}}">
<div class="border p-2 mb-2">
{{#canmanagetemplatecompetencies}}
<span class="drag-handlecontainer float-left"></span>
<div class="float-sm-right">
<a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
</div>
{{/canmanagetemplatecompetencies}}
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<strong>{{#str}}linkedcourseslist, tool_lp{{/str}}</strong>
{{#hascourses}}
<ul class="inline list-inline">
{{#linkedcourses}}
<li class="list-inline-item"><a href="{{viewurl}}?id={{id}}">{{{fullname}}} ({{{shortname}}})</a></li>
{{/linkedcourses}}
</ul>
{{/hascourses}}
{{^hascourses}}
<span class="badge bg-info text-white">{{#str}}nolinkedcourses, tool_lp{{/str}}</span>
{{/hascourses}}
</div>
</div>
{{/competencies}}
</div>
</div>
{{^competencies}}
<p class="alert alert-info">
{{#str}}nocompetenciesintemplate, tool_lp{{/str}}
</p>
{{/competencies}}
</div>
<div data-region="actions">
{{#canmanagecompetencyframeworks}}
<div>
<p><a href="{{manageurl}}">{{#str}}managecompetenciesandframeworks, tool_lp{{/str}}</a></p>
</div>
{{/canmanagecompetencyframeworks}}
</div>
</div>
{{#js}}
require(['tool_lp/competencies'], function(mod) {
(new mod({{template.id}}, 'template', {{pagecontextid}}));
});
{{/js}}
@@ -0,0 +1,93 @@
{{!
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/template_statistics
IDs required for JS:
* none
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
See competency/classes/external/template_statistics_exporter
Example context (json):
{
"linkedcompetencycount": 4,
"competencycount": 8,
"linkedcompetencypercentage": 50,
"plancount": 40,
"completedplancount": 30,
"completedplanpercentage": 75
}
}}
{{!
Template statistics template.
}}
{{#competencycount}}
<div data-region="templatestatistics" class="border p-2 mb-2">
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}xcompetencieslinkedoutofy, tool_lp, { "x": "{{linkedcompetencycount}}", "y": "{{competencycount}}" } {{/str}}
{{/progresstext}}
{{$percentage}}{{linkedcompetencypercentage}}{{/percentage}}
{{$percentlabel}}{{linkedcompetencypercentageformatted}}&nbsp;%{{/percentlabel}}
{{/tool_lp/progress_bar}}
{{#plancount}}
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}xplanscompletedoutofy, tool_lp, { "x": "{{completedplancount}}", "y": "{{plancount}}" } {{/str}}
{{/progresstext}}
{{$percentage}}{{completedplanpercentage}}{{/percentage}}
{{$percentlabel}}{{completedplanpercentageformatted}}&nbsp;%{{/percentlabel}}
{{/tool_lp/progress_bar}}
{{/plancount}}
{{#usercompetencyplancount}}
{{< tool_lp/progress_bar}}
{{$progresstext}}
{{#str}}averageproficiencyrate, tool_lp, {{proficientusercompetencyplanpercentageformatted}} {{/str}}
{{/progresstext}}
{{$percentage}}{{proficientusercompetencyplanpercentage}}{{/percentage}}
{{$percentlabel}}{{proficientusercompetencyplanpercentageformatted}}&nbsp;%{{/percentlabel}}
{{/tool_lp/progress_bar}}
{{/usercompetencyplancount}}
{{#leastproficientcount}}
<div>
<div>
<p>{{#str}}competenciesmostoftennotproficient, tool_lp{{/str}}</p>
</div>
<div>
{{#leastproficient}}
{{#showcompetencylinks}}
<a href="#competency_link_{{id}}">
{{/showcompetencylinks}}
<div><p>{{{shortname}}} <em>{{idnumber}}</em></p></div>
{{#showcompetencylinks}}
</a>
{{/showcompetencylinks}}
{{/leastproficient}}
</div>
</div>
{{/leastproficientcount}}
</div>
{{/competencycount}}
@@ -0,0 +1,78 @@
{{!
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_course_navigation
Show an auto-complete for jumping to competencies in a plan.
Context variables required for this template:
* groupselector - HTML
* hasusers
* users - array
* id
* selected
* fullname
* hascompetencies
* competencies - array
* id
* selected
* shortname
* idnumber
// No example context because the JS is connected to webservices
}}
<div class="float-sm-right border p-2 mb-2">
<p>{{{groupselector}}}</p>
<form class="user-competency-course-navigation">
<input type="hidden" name="userid" value="{{userid}}"/>
<input type="hidden" name="competencyid" value="{{competencyid}}"/>
<input type="hidden" name="courseid" value="{{courseid}}"/>
{{#hasusers}}
<span>
<label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
<select id="user-nav-{{uniqid}}" class="custom-select">
{{#users}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{fullname}}</option>
{{/users}}
</select>
</span>
{{/hasusers}}
<br>
{{#hascompetencies}}
<span>
<label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
<select id="competency-nav-{{uniqid}}" class="custom-select">
{{#competencies}}
<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} {{idnumber}}</option>
{{/competencies}}
</select>
</span>
{{/hascompetencies}}
</form>
</div>
{{#js}}
require(['core/form-autocomplete', 'tool_lp/user_competency_course_navigation'], function(autocomplete, nav) {
(new nav('#user-nav-{{uniqid}}', '#competency-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{competencyid}}, {{courseid}}));
{{#hasusers}}
autocomplete.enhance('#user-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptouser, tool_lp{{/ str }}{{/ quote }});
{{/hasusers}}
{{#hascompetencies}}
autocomplete.enhance('#competency-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptocompetency, tool_lp{{/ str }}{{/ quote }});
{{/hascompetencies}}
});
{{/js}}
@@ -0,0 +1,105 @@
{{!
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
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
* competency - competency summary record
* user - user record
* usercompetency - user competency record
* evidence - array of evidence
This template does not have an example context because it includes ajax functionality.
}}
<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
<div data-region="competency-summary">
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<dl>
{{#usercompetency}}
<dt>{{#str}}reviewstatus, tool_lp{{/str}}</dt>
<dd data-region="user-competency-status">{{statusname}}
{{#isstatusinreview}}
- {{reviewer.fullname}}
{{/isstatusinreview}}
{{#isrequestreviewallowed}}<button class="btn btn-secondary" data-action="request-review">{{#str}}requestreview, tool_lp{{/str}}</button>{{/isrequestreviewallowed}}
{{#iscancelreviewrequestallowed}}<button class="btn btn-secondary" data-action="cancel-review-request">{{#str}}cancelreviewrequest, tool_lp{{/str}}</button>{{/iscancelreviewrequestallowed}}
{{#isstartreviewallowed}}<button class="btn btn-secondary" data-action="start-review">{{#str}}startreview, tool_lp{{/str}}</button>{{/isstartreviewallowed}}
{{#isstopreviewallowed}}<button class="btn btn-secondary" data-action="stop-review">{{#str}}stopreview, tool_lp{{/str}}</button>{{/isstopreviewallowed}}
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}}
</span>
</dd>
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info', 'tool_lp/user_competency_workflow'], function($, mod, info, UserCompWorkflow) {
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}');
var ucw = new UserCompWorkflow();
ucw.registerEvents('[data-region="user-competency-status"]');
ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
{{#cangrade}}
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{/cangrade}}
});
{{/js}}
{{/usercompetency}}
</dl>
{{#commentarea}}
{{#canpostorhascomments}}
{{>tool_lp/comment_area}}
{{/canpostorhascomments}}
{{/commentarea}}
<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>
</div>
@@ -0,0 +1,128 @@
{{!
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
* 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" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
<div data-region="competency-summary">
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<dl>
<dt>{{#str}}activities, tool_lp{{/str}}</dt>
<dd data-region="coursecompetencyactivities">
<p>
<ul class="inline list-inline">
{{#coursemodules}}
<li class="list-inline-item"><a href="{{url}}"><img class="icon" src="{{iconurl}}" alt=""> {{name}} </a></li>
{{/coursemodules}}
{{^coursemodules}}
<li class="list-inline-item"><span class="alert">{{#str}}noactivities, tool_lp{{/str}}</span></li>
{{/coursemodules}}
</ul>
</p>
</dd>
{{#displayuser}}
{{#user}}
<dt>{{#str}}user{{/str}}</dt>
<dd>
{{>tool_lp/user_summary}}
</dd>
{{/user}}
{{/displayuser}}
<dt>{{#str}}userplans, competency{{/str}}</dt>
<dd>
<p>
<ul class="inline list-inline">
{{#plans}}
<li class="list-inline-item"><a href="{{pluginbaseurl}}/plan.php?id={{id}}">{{{name}}}</a></li>
{{/plans}}
{{^plans}}
<li>{{#str}}nouserplanswithcompetency, competency{{/str}}</li>
{{/plans}}
</ul>
</p>
</dd>
{{#usercompetencycourse}}
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}}
</span>
</dd>
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{/usercompetencycourse}}
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var displayuser = ('{{displayuser}}' == 'true') ? true : false;
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
{{#cangrade}}
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{/cangrade}}
});
{{/js}}
</dl>
{{#commentarea}}
{{#canpostorhascomments}}
{{>tool_lp/comment_area}}
{{/canpostorhascomments}}
{{/commentarea}}
<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>
</div>
{{/usercompetencysummary}}
@@ -0,0 +1,129 @@
{{!
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_plan
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
* competency - competency summary record
* user - user record
* usercompetency - user competency record
* usercompetencyplan - user competency plan record
* evidence - array of evidence
* commentarea - comment block
* plan - plan summary record
* iscompleted - is completed
This template does not have an example context because it includes ajax functionality.
}}
{{#usercompetencysummary}}
<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
<div>{{{plan.description}}}</div>
{{#plan.iscompleted}}
<div class="alert alert-info" role="alert">
{{#str}} usercompetencyfrozen, tool_lp {{/str}}
</div>
{{/plan.iscompleted}}
<div data-region="competency-summary">
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<dl>
{{#usercompetency}}
<dt>{{#str}}reviewstatus, tool_lp{{/str}}</dt>
<dd data-region="user-competency-status">{{statusname}}
{{#isstatusinreview}}
- {{reviewer.fullname}}
{{/isstatusinreview}}
{{#isrequestreviewallowed}}<button class="btn btn-secondary" data-action="request-review">{{#str}}requestreview, tool_lp{{/str}}</button>{{/isrequestreviewallowed}}
{{#iscancelreviewrequestallowed}}<button class="btn btn-secondary" data-action="cancel-review-request">{{#str}}cancelreviewrequest, tool_lp{{/str}}</button>{{/iscancelreviewrequestallowed}}
{{#isstartreviewallowed}}<button class="btn btn-secondary" data-action="start-review">{{#str}}startreview, tool_lp{{/str}}</button>{{/isstartreviewallowed}}
{{#isstopreviewallowed}}<button class="btn btn-secondary" data-action="stop-review">{{#str}}stopreview, tool_lp{{/str}}</button>{{/isstopreviewallowed}}
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}}
</span>
</dd>
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info', 'tool_lp/user_competency_workflow'], function($, mod, info, UserCompWorkflow) {
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}');
var ucw = new UserCompWorkflow();
ucw.registerEvents('[data-region="user-competency-status"]');
ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
{{#cangrade}}
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{/cangrade}}
});
{{/js}}
{{/usercompetency}}
{{#usercompetencyplan}}
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}} - {{#str}}plancompleted, tool_lp{{/str}}</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
{{proficiencyname}}
</span>
</dd>
{{/usercompetencyplan}}
</dl>
{{#commentarea}}
{{#canpostorhascomments}}
{{>tool_lp/comment_area}}
{{/canpostorhascomments}}
{{/commentarea}}
<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>
</div>
{{/usercompetencysummary}}
@@ -0,0 +1,136 @@
{{!
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/>.
}}
{{!
User evidence list page.
Data attributes required for JS:
* data-action = user-evidence-delete
* data-region = user-evidence-list
* data-region = user-evidence-node
* data-id = user evidence ID
* data-userid = user evidence user ID
Context variables required for this template:
* userid - The ID of the user whose page we're viewing
* canmanage - Whether the current user can manage the evidence
* evidence - The list of evidence
* navigation - Buttons to add to the page
* pluginbaseurl - The plugin base URL
}}
<div data-region="user-evidence-list">
<div class="float-left">
{{#navigation}}
{{{.}}}
{{/navigation}}
</div>
<table class="generaltable fullwidth">
<caption>{{#str}}listofevidence, tool_lp{{/str}}</caption>
<thead>
<tr>
<th scope="col" width="20%">{{#str}}userevidencename, tool_lp{{/str}}</th>
<th scope="col">{{#str}}userevidencesummary, tool_lp{{/str}}</th>
<th scope="col">{{#str}}linkedcompetencies, tool_lp{{/str}} ({{#str}}status, tool_lp{{/str}} / {{#str}}reviewer, tool_lp{{/str}})</th>
{{#canmanage}}
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
{{/canmanage}}
</tr>
</thead>
<tbody>
{{#evidence}}
<tr data-region='user-evidence-node' data-id="{{id}}" data-userid="{{userid}}">
<td><a href="{{pluginbaseurl}}/user_evidence.php?id={{id}}">{{{name}}}</a></td>
<td>
{{^hasurlorfiles}}
-
{{/hasurlorfiles}}
{{#hasurlorfiles}}
<ul class="user-evidence-documents">
{{#url}}
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}}
{{#files}}
<li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}" title="{{filename}}">{{filenameshort}}</a></li>
{{/files}}
</ul>
{{/hasurlorfiles}}
</td>
<td>
{{^competencycount}}
-
{{/competencycount}}
{{#competencycount}}
<ul class="user-evidence-competencies">
{{#usercompetencies}}
<li>
{{{competency.shortname}}} <small><em>{{competency.idnumber}}</em></small> ({{usercompetency.statusname}}{{#usercompetency.reviewer.fullname}} / {{usercompetency.reviewer.fullname}}{{/usercompetency.reviewer.fullname}})
</li>
{{/usercompetencies}}
</ul>
{{/competencycount}}
</td>
{{#canmanage}}
<td>
<div style="display: inline-block;">
<ul title="{{#str}}edit{{/str}}" class="user-evidence-actions">
<li>
<a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
<ul class="dropdown dropdown-menu">
<li class="dropdown-item">
<a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&amp;userid={{userid}}&amp;return=list">
{{#pix}}t/edit{{/pix}} {{#str}}editthisuserevidence, tool_lp{{/str}}
</a>
</li>
{{#userhasplan}}
<li class="dropdown-item">
<a href="#" data-action="link-competency">
{{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}
</a>
</li>
{{/userhasplan}}
<li class="dropdown-item">
<a data-action="send-competencies-review" href="#">
{{#pix}}t/edit{{/pix}} {{#str}}sendcompetenciestoreview, tool_lp{{/str}}
</a>
</li>
<li class="dropdown-item">
<a data-action="user-evidence-delete" href="#">
{{#pix}}t/delete{{/pix}} {{#str}}deletethisuserevidence, tool_lp{{/str}}
</a>
</li>
</ul>
</ul>
</div>
{{/canmanage}}
</td>
</tr>
{{/evidence}}
</tbody>
</table>
{{^evidence}}
<p class="alert alert-info">{{#str}}nouserevidence, tool_lp{{/str}}</p>
{{/evidence}}
</div>
{{#js}}
require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
var uea = new UserEvidenceActions('list');
uea.enhanceMenubar('.user-evidence-actions');
});
{{/js}}
@@ -0,0 +1,122 @@
{{!
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/>.
}}
{{!
User evidence page template.
Data attributes required for JS:
* data-action = link-competency
* data-action = delete-competency-link
* data-region = user-evidence-page
* data-id = user evidence ID, or competency ID
* data-userid = user evidence user ID
Context variables required for this template:
* userevidence - The user evidence
* pluginbaseurl - The plugin base URL
}}
{{#userevidence}}
<div data-region="user-evidence-page" data-id="{{id}}" data-userid="{{userid}}">
<h2>
{{{name}}}
{{#canmanage}}
<a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&amp;userid={{userid}}">{{#pix}}t/edit, core, {{#str}}editthisuserevidence, tool_lp{{/str}}{{/pix}}</a>
{{/canmanage}}
</h2>
{{#canmanage}}
<div data-region="actions" class="clearfix">
<div class="float-left">
{{#userhasplan}}
<button class="btn btn-secondary mb-1" data-action="link-competency">{{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}</button>
{{/userhasplan}}
</div>
</div>
{{/canmanage}}
<div data-region="user-evidence-summary">
{{#description}}
<div>
{{{description}}}
</div>
{{/description}}
<ul class="user-evidence-documents">
{{#url}}
<li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
{{/url}}
{{#files}}
<li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}">{{filename}}</a></li>
{{/files}}
</ul>
</div>
<div data-region="user-evidence-competencies">
<h3>{{#str}}linkedcompetencies, tool_lp{{/str}}</h3>
<table class="generaltable fullwidth">
<thead>
<tr>
<th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
<th scope="col">{{#str}}status, tool_lp{{/str}} / {{#str}}reviewer, tool_lp{{/str}}</th>
{{#canmanage}}
<th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
{{/canmanage}}
</tr>
</thead>
<tbody>
{{#usercompetencies}}
<tr data-id="{{competency.id}}">
<td>
<a href="{{pluginbaseurl}}/user_competency.php?id={{usercompetency.id}}" data-id="{{usercompetency.id}}">{{{competency.shortname}}}</a>
</td>
<td>
{{usercompetency.statusname}} {{#usercompetency.reviewer.fullname}} / {{usercompetency.reviewer.fullname}}{{/usercompetency.reviewer.fullname}}
</td>
{{#userevidence.canmanage}}
<td>
<div class="float-left">
<a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
</div>
</td>
{{/userevidence.canmanage}}
</tr>
{{/usercompetencies}}
</tbody>
</table>
{{^usercompetencies}}
<p class="alert alert-info">
{{#str}}nocompetenciesinevidence, tool_lp{{/str}}
</p>
{{/usercompetencies}}
</div>
</div>
{{#canmanage}}
{{#js}}
require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
var uea = new UserEvidenceActions('evidence');
uea.registerEvents();
});
{{/js}}
{{/canmanage}}
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
Compdialogue.init();
});
{{/js}}
{{/userevidence}}
@@ -0,0 +1,59 @@
{{!
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_summary
Moodle template for the list of valid options in an autocomplate form element.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* profileimageurlsmall Url to a small profile image.
* profileimageurl Url to a profile image.
* fullname Users full name
* hasidentity boolean to say if there are identity fields to show
* identity concatenated list of identity fields.
* id user id field
* email user email field
* idnumber user idnumber field
* phone1 user phone1 field
* phone2 user phone2 field
* department user department field
* institution user institution field
Example context (json):
{ "id": "1",
"fullname": "Admin",
"hasidentity": true,
"identity": "Admin User, 0144114141",
"profileimageurl": "invalid url",
"profileimageurlsmall": "invalid url"
}
}}
<span>
<a href="{{profileurl}}" title="{{#str}}viewprofile{{/str}}">
<img height="18" src="{{profileimageurlsmall}}" alt="">
<span>{{fullname}}</span>
{{#hasidentity}}
<span><small>{{identity}}</small></span>
{{/hasidentity}}
</a>
</span>