Skip to content
Snippets Groups Projects
Commit 7b9e4fe6 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

graph + taxonomy

parent a861a465
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ $thingnode = $coursenode->add(get_string('dashboard_students', 'block_competency
$thingnode->make_active();
$PAGE->requires->js("/blocks/competency_iena/js/dropdown.js");
$PAGE->requires->css("/blocks/competency_iena/styles.css");
echo $OUTPUT->header();
$sql = "SELECT * FROM {competency_usercomp}
......@@ -63,19 +64,35 @@ $sql = "SELECT * FROM {competency_usercomp}
}
$chart = new \core\chart_pie();
$proficiency_serie = new core\chart_series('', [$count_proficients, $count_course_cpts - $count_proficients]);
$proficiency_serie = new core\chart_series(get_string('competencies', 'core_competency'), [$count_proficients, $count_course_cpts - $count_proficients]);
$chart->set_doughnut(true);
$chart->add_series($proficiency_serie);
$chart->set_labels(["Validé", "Non validé"]);
foreach ($user_course_competencies as $user_course_competency) {
$array_frameworks=array();
foreach ($user_course_competencies as $user_course_competency) {
// Crée un obj cpt à partir de l'ID. Attention, id de compétence et course_competency sont différents.
$cpt = new \core_competency\competency($user_course_competency->get('competencyid'));
/* Visuel indentation to reflect levels in cpt framework */
$cpt_level_in_framework = substr_count($cpt->get('path'), '/') - 1; /* start at 1 */
$user_course_competency->level_indentation = $cpt_level_in_framework * 1.5;
$user_course_competency->cpt_level_in_framework=$cpt_level_in_framework;
$framework_id=$cpt->get('competencyframeworkid');
if(!in_array($framework_id,array_keys($array_frameworks))){
$framework = new \core_competency\competency_framework($cpt->get('competencyframeworkid'));
$array_frameworks[$framework_id]=array();
$array_frameworks[$framework_id]['taxonomy']=$framework->get('taxonomies');
}
$user_course_competency->taxonomy=get_string("taxonomy_".$array_frameworks[$framework_id]["taxonomy"][$cpt_level_in_framework], 'core_competency');
// Récupère les chaines de caractère de l'échelle d'évaluation
$cpt_scale = $cpt->get_scale()->scale_items;
$user_course_competency->eval = "-";
......@@ -88,11 +105,11 @@ foreach ($user_course_competencies as $user_course_competency) {
$user_course_competency->link=$CFG->wwwroot."/blocks/competency_iena/course_competency.php?courseid=".$COURSE->id."&studentid=".$student->studentid."&competencyid=".$cpt->get('id');
foreach ($reviews_data as $review) {
if ( $review->competencyid == $cpt->get('id') ) {
error_log("Oui on a une demande");
$user_course_competency->review_asked=true;
break;
}
}
//$user_course_competency->reviews_data=array_values($reviews_data);
}
......
......@@ -16,17 +16,5 @@
<KEY NAME="sectionid" TYPE="foreign" FIELDS="sectionid" REFTABLE="course_sections" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="block_competency_iena" COMMENT="Default comment for block_competency_iena, please edit me">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="module id"/>
<FIELD NAME="sectionid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="cmid" TYPE="foreign" FIELDS="cmid" REFTABLE="course_modules" REFFIELDS="id"/>
<KEY NAME="sectionid" TYPE="foreign" FIELDS="sectionid" REFTABLE="course_sections" REFFIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
......@@ -274,3 +274,36 @@ table.dataTable{
min-width: 355px;
}
.chart-area{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.chart-image, .chart-table{
flex-grow: 1;
}
.chart-image{
max-width: 40%;
}
.taxo-lvl1 small{
background-color: #223D4F;
}
.taxo-lvl2 small{
background-color: #355E7A;
}
.taxo-lvl3 small{
background-color: #5090BA;
}
.taxo-lvl4 small{
background-color: #60ADE0;
}
.iena-taxonomy{
margin-bottom: 5px;
}
......@@ -2,7 +2,7 @@
{{#count_course_cpts}}
<div class='container-fluid' id='dash-container'>
<div class='alert alert-secondary row' style='padding-top: 1.5rem;'>
<div class='col-12 col-lg-6'>
<div class='col-12'>
<!--<h2 class='h3'>{{student.firstname}} {{student.lastname}}</h2>-->
......@@ -21,19 +21,24 @@
</div>
</form>
{{/is_not_student}}
<h2 class='h4 m-t-2'>Demandes d'évaluations <span class='badge badge-pill badge-primary' style='border-radius: 0.15rem;'>{{reviews_count}}</span></h2>
</div>
<div class='col-12 col-lg-6'>
<div class='col-12'>
<h2 class='h4'>Compétences validées</h2>
{{{chart}}}
</div>
</div>
<div class='row'>
<div class='col-12' style='padding: 0;'>
<h2 class='h4 m-t-2'>Demandes d'évaluations <span class='badge badge-pill badge-primary' style='border-radius: 0.15rem;'>{{reviews_count}}</span></h2>
<div class='list-group'>
{{#user_course_competencies}}
<a href='{{link}}' class='list-group-item list-group-item-action{{proficient_class}}' style='padding-left: {{level_indentation}}rem;'>
<div class="iena-taxonomy taxo-lvl{{cpt_level_in_framework}}"><small class='review-badge'>{{taxonomy}}</small></div>
<div class='d-flex w-100 justify-content-between'>
<h3 class='mb-1 iena-cpt-action-title h5'>{{shortname}}</h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment