Skip to content

Commit

Permalink
MDL-52741 tool_lp: Display taxonomy term with competency summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Apr 18, 2016
1 parent 90c7bda commit 1ca0d7c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use context_course;
use renderer_base;
use stdClass;
use \tool_lp\competency_framework;

/**
* Class for exporting competency data with additional related data.
Expand Down Expand Up @@ -69,6 +70,9 @@ protected static function define_other_properties() {
),
'scaleconfiguration' => array(
'type' => PARAM_RAW
),
'taxonomyterm' => array(
'type' => PARAM_TEXT
)
);
}
Expand Down Expand Up @@ -109,6 +113,10 @@ protected function get_other_values(renderer_base $output) {
}
$result->scaleconfiguration = $scaleconfiguration;

$level = $competency->get_level();
$taxonomy = $this->related['framework']->get_taxonomy($level);
$result->taxonomyterm = (string) (competency_framework::get_taxonomies_list()[$taxonomy]);

return (array) $result;
}
}
7 changes: 7 additions & 0 deletions admin/tool/lp/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
width: 50px;
}

.competency-heading {
margin-bottom: 15px;
}
.competency-heading h4 {
margin: 0;
}

/** Styles required for menubar js */

.tool-lp-menu {
Expand Down
19 changes: 13 additions & 6 deletions admin/tool/lp/templates/competency_summary.mustache
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<p><strong>{{competency.shortname}} <em>{{competency.idnumber}}</em></strong></p>
<p>{{{competency.description}}}</p>
<div class='competency-heading'>
<h4>{{competency.shortname}}
<small>{{competency.idnumber}}</small>
</h4>
{{#framework}}
<div class='competency-origin'>
<p><small>{{framework.shortname}} - {{taxonomyterm}}</small>
</div>
{{/framework}}
</div>

{{#framework}}
<p><strong>{{framework.shortname}}</strong></p>
<p>{{{framework.description}}}</p>
{{/framework}}
{{#competency.description}}
<p>{{{competency.description}}}</p>
{{/competency.description}}

{{#showrelatedcompetencies}}
{{> tool_lp/related_competencies }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
{{/canmanagetemplatecompetencies}}
{{#competency}}
{{> tool_lp/competency_summary }}
{{> tool_lp/competency_summary }}
{{/competency}}
<strong>{{#str}}linkedcourses, tool_lp{{/str}}</strong>
{{#hascourses}}
Expand Down
5 changes: 1 addition & 4 deletions admin/tool/lp/user_competency_in_plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@
$url = new moodle_url('/admin/tool/lp/user_competency_in_plan.php', $params);
$competency = new \tool_lp\competency($competencyid);
$framework = $competency->get_framework();
$subtitle = $competency->get_shortname();

list($title, $subtitle) = \tool_lp\page_helper::setup_for_plan($userid, $url, $plan,
$subtitle);
list($title, $subtitle) = \tool_lp\page_helper::setup_for_plan($userid, $url, $plan);

$output = $PAGE->get_renderer('tool_lp');
echo $output->header();
echo $output->heading($title);
echo $output->heading($subtitle, 3);

$page = new \tool_lp\output\user_competency_summary_in_plan($competencyid, $planid);
echo $output->render($page);
Expand Down

0 comments on commit 1ca0d7c

Please sign in to comment.