From 36207ab217cadc98cfc3b874902883a780d9a232 Mon Sep 17 00:00:00 2001
From: Myriam Delaruelle
<Myriam Delaruelle@bdn-un-mdelarue.ad.univ-lorraine.fr>
Date: Mon, 11 Oct 2021 14:53:14 +0200
Subject: [PATCH] template dashboard competencies
---
competency_iena_competency_students_2.php | 272 +++++++++-------------
js/dropdown.js | 5 +-
lang/en/block_competency_iena.php | 4 +
lang/fr/block_competency_iena.php | 4 +
renderer.php | 4 +
styles.css | 9 +-
templates/dashboard_competencies.mustache | 93 +++++++-
templates/dashboard_students.mustache | 113 ++++-----
8 files changed, 282 insertions(+), 222 deletions(-)
diff --git a/competency_iena_competency_students_2.php b/competency_iena_competency_students_2.php
index d96adac..cc0b8c6 100644
--- a/competency_iena_competency_students_2.php
+++ b/competency_iena_competency_students_2.php
@@ -30,16 +30,16 @@ if (!has_capability('moodle/course:update', $context = context_course::instance(
require_login($course, false, NULL);
$PAGE->set_title(get_string('title_plugin', 'block_competency_iena'));
+$PAGE->set_heading($OUTPUT->heading($COURSE->fullname, 2, 'headingblock header outline'));
+
+$coursenode = $PAGE->navigation->find($course->id, navigation_node::TYPE_COURSE);
+$thingnode = $coursenode->add(get_string('dashboard_competencies', 'block_competency_iena'));
+$thingnode->make_active();
/* Liste des compétences du cours */
$course_cpts = \core_competency\course_competency::list_competencies($COURSE->id);
-if (count($course_cpts) === 0) {
- $PAGE->set_heading($OUTPUT->heading($COURSE->fullname, 2, 'headingblock header outline'));
- echo $OUTPUT->header();
- echo "<p class='alert alert-warning'>Pour le moment, aucune compétence n'a été liée à ce cours. Pour lier des compétences au cours et les associer à des activités, rendez-vous dans la page <a href='{$CFG->wwwroot}/blocks/competency_iena/competency_iena_competencies_mgmt.php?courseid={$courseid}'>Gestion des compétences</a>. </p>";
- echo $OUTPUT->footer();
-} else {
+if (count($course_cpts) > 0) {
$current_cpt = new stdClass();
foreach ($course_cpts as $course_cpt) {
@@ -51,7 +51,6 @@ if (count($course_cpts) === 0) {
}
}
- $PAGE->set_heading($OUTPUT->heading($current_cpt->shortname, 2, 'headingblock header outline'));
$PAGE->requires->js("/blocks/competency_iena/js/dropdown.js");
echo $OUTPUT->header();
@@ -64,56 +63,13 @@ if (count($course_cpts) === 0) {
$student_ids[] = intval($stud->id);
}
- echo "<div class='container-fluid' id='dash-container'>";
- /* ===== CHANGE COMPETENCY ===== */
- /* There is 2 forms witch use data from each other while submitting. */
-
- echo "<div class='alert row' style='padding: 0; background-color: inherit; color: inherit;'>"; /* Début change competency. */
- echo "<div class='col-12' style='padding-left: 0;'>";
- echo "<form action='{$CFG->wwwroot}/blocks/competency_iena/competency_iena_competency_students_2.php' id='change_cpt_form' class='form-inline' autocomplete='off' style='display: block;height: 1.5rem;'>";
- echo "<input type='text' hidden name='courseid' value='{$COURSE->id}'>";
- if ( isset($_GET['grade']) ) {
- echo "<input type='text' hidden name='grade' value='{$_GET['grade']}'>";
- }
- if ( isset($_GET['proficiency']) ) {
- echo "<input type='text' hidden name='proficiency' value='{$_GET['proficiency']}'>";
- }
- if ( isset($_GET['review']) ) {
- echo "<input type='text' hidden name='review' value='{$_GET['review']}'>";
- }
- echo "<span hidden id='competencyid'>{$current_cpt->id}</span>";
-
- // echo "<input type='text' name='competencyid' id='competencyid_sel' value='' list='competency_list' class='form-control'>";
- // echo "<datalist id='competency_list' title='Select competency'>";
- // foreach ($course_cpts as $course_cpt) {
- // echo "<option value='{$course_cpt->get('shortname')} ({$course_cpt->get('id')})' data-value='{$course_cpt->get('id')}'>{$course_cpt->get('shortname')} ({$course_cpt->get('id')})</option>";
- // }
- // echo "</datalist>";
- // echo "<button class='btn btn-secondary m-l-1' id='prevCpt'>Précédent</button>";
- // echo "<button class='btn btn-secondary m-l-1' id='nextCpt'>Suivant</button>";
-
- echo "<div id='student_dropdown' class='iena-dropdown' style='z-index: 1;'>";
- echo "<input type='text' hidden name='competencyid' id='competencyid_sel' class='iena-drop-input-value' value=''>";
- echo "<input type='text' value='' class='form-control iena-drop-input' style='font-size: .7rem; line-height: 1; width: 300px;' placeholder='{$current_cpt->shortname}' autocomplete='nope'><button class='btn btn-secondary' id='prevCpt' style='font-size: .8rem;line-height: 1.09; margin-left: 0.5rem;'>Précédent</button><button class='btn btn-secondary' id='nextCpt' style='font-size: .8rem;line-height: 1.09; margin-left: 0.5rem;'>Suivant</button>";
- echo "<div class='iena-droplist' id='competency_list'>";
foreach ($course_cpts as $course_cpt) {
- echo "<a href='#' data-value='{$course_cpt->get('id')}' class='iena-drop-item' style='display: none;'>{$course_cpt->get('shortname')}</a>";
+ $course_cpt->id=$course_cpt->get('id');
+ $course_cpt->shortname=$course_cpt->get('shortname');
}
- echo "</div>";
- echo "</div>";
-
- echo "</form>";
- echo "</div>";
- echo "</div>"; /* Fin change competency. */
-
- /* ===== DASHBOARD ===== */
-
- echo "<div class='alert alert-secondary row' style='padding-top: 1.5rem;'>"; /* Début tableau de bord. */
-
- /* <<< PROFICIENCY SECTION >>> */
- echo "<div class='col-12 col-lg-6'>";
+
/* Nombre d'enregistrements, donc d'étudiants, proficients pour la compétence courante. */
$count_proficients = $DB->count_records('competency_usercompcourse', [
'courseid' => $COURSE->id,
@@ -121,20 +77,15 @@ if (count($course_cpts) === 0) {
'competencyid' => $current_cpt->id
]);
- echo "<h2 class='h4'>Compétences validées</h2>";
- $chart = new \core\chart_pie();
- $proficiency_serie = new core\chart_series('', [$count_proficients, $count_students - $count_proficients]);
- $chart->set_doughnut(true);
- $chart->add_series($proficiency_serie);
- $chart->set_labels(["Validé", "Non validé"]);
- echo $OUTPUT->render($chart);
+ $chart_proficiency = new \core\chart_pie();
+ $proficiency_serie = new core\chart_series(get_string('students'), [$count_proficients, $count_students - $count_proficients]);
+ $chart_proficiency->set_doughnut(true);
+ $chart_proficiency->add_series($proficiency_serie);
+ $chart_proficiency->set_labels(["Validé", "Non validé"]);
+
- echo "</div>"; /* proficiency section end */
- /* <<< GRADE SECTION >>> */
- echo "<div class='col-12 col-lg-6'>";
- echo "<h2 class='h4'>Évaluations</h2>";
/* Nombre d'enregistrements, donc d'étudiants, de chaque grade sur la scale d'évaluation. */
$bd_grades = $DB->get_records('competency_usercompcourse', ['courseid' => $COURSE->id, 'competencyid' => $current_cpt->id], '', 'id, grade');
@@ -158,15 +109,11 @@ if (count($course_cpts) === 0) {
$scale_for_labels = $current_cpt->scale;
$scale_for_labels[] = "Non évalués";
/* Graphique MOODLE */
- $chart = new core\chart_bar();
+ $chart_assess = new core\chart_bar();
$grade_serie = new core\chart_series('', $grade_scale_counter);
- $chart->add_series($grade_serie);
- $chart->set_labels($scale_for_labels);
- echo $OUTPUT->render($chart);
- echo "</div>"; /* grade section end */
+ $chart_assess->add_series($grade_serie);
+ $chart_assess->set_labels($scale_for_labels);
- /* <<< TO REVIEW SECTION >>> */
- echo "<div class='col-12'>";
list($in_sql_stud_ids, $params_stud_ids) = $DB->get_in_or_equal($student_ids);
$sql = "SELECT * FROM {competency_usercomp}
@@ -178,67 +125,80 @@ if (count($course_cpts) === 0) {
$reviews_data = $DB->get_records_sql($sql, $params_rev);
$reviews_count = count($reviews_data);
- echo "<h2 class='h4'>Demandes d'évaluations <span class='badge badge-pill badge-primary' style=' border-radius: 0.15rem;'>$reviews_count</span></h2>";
- echo "</div>"; /* to review section end */
-
- echo "</div>"; /* Fin tableau de bord. */
+ $options_grade=array();
- /* ===== FILTERS ===== */
- /* There is 2 forms witch use data from each other while submitting. */
-
- echo "<div class='alert alert-secondary row'>"; /* Début filtres. */
- echo "<div class='col-12'>";
-
- echo "<form action='{$CFG->wwwroot}/blocks/competency_iena/competency_iena_competency_students_2.php#dash-container' class='form-inline'>";
- echo "<input type='text' hidden name='courseid' value='{$COURSE->id}'>";
- echo "<input type='text' hidden name='competencyid' value='{$current_cpt->id}'>";
+ $form_grade = isset($_GET['grade']) ? $_GET['grade'] : 'all';
+ $option=new stdClass();
+ $option->value='all';
+ $option->label=get_string('all');
+ if ( $form_grade == 'all' ) {
+ $option->selected='selected';
+ }
+ array_push($options_grade, $option);
- echo "<label>Évaluation</label><select name='grade' class='custom-select mr-3'>";
+
+ $option=new stdClass();
+ $option->value='no';
+ $option->label=get_string('not_assessed', 'block_competency_iena');
+
+ if ( $form_grade == 'no' ) {
+ $option->selected='selected';
+
+ } else {
+ $option->selected='';
+ }
+ array_push($options_grade, $option);
- $form_grade = isset($_GET['grade']) ? $_GET['grade'] : 'all';
- if ( $form_grade == 'all' ) { echo "<option value='all' selected>Tous</option>"; } else { echo "<option value='all'>Tous</option>"; }
- if ( $form_grade == 'no' ) { echo "<option value='no' selected>Non évalués</option>"; } else { echo "<option value='no'>Non évalués</option>"; }
foreach ($current_cpt->scale as $key => $scale_item) {
$strkey = strval($key + 1);
- echo "<option value='{$strkey}'";
- if ( $form_grade == $strkey ) { echo "selected"; }
- echo ">{$scale_item}</option>";
+ $option=new stdClass();
+ $option->value=$strkey;
+ $option->label=$scale_item;
+ if ( $form_grade == $strkey ) {
+ $option->selected='selected';
+ }
+ array_push($options_grade, $option);
}
- echo "</select>";
+
+
$form_proficiency = isset($_GET['proficiency']) ? $_GET['proficiency'] : 'all';
- echo "<label>Validé</label><select name='proficiency' class='custom-select mr-3'>
- <option value='all'";
- if ( $form_proficiency == 'all' ) { echo 'selected'; }
- echo ">Tous</option>
- <option value='no'";
- if ( $form_proficiency == 'no' ) { echo 'selected'; }
- echo ">Non</option>
- <option value='yes'";
- if ( $form_proficiency == 'yes' ) { echo 'selected'; }
- echo ">Oui</option>
- </select>";
+ $options_proficiency=array();
+ $option=new stdClass();
+ $option->value='all';
+ $option->label=get_string('all');
+ if ( $form_proficiency == 'all' ) { $option->selected="selected"; }
+ array_push($options_proficiency, $option);
+ $option=new stdClass();
+ $option->value='no';
+ $option->label=get_string('no');
+ if ( $form_proficiency == 'no' ) { $option->selected="selected"; }
+ array_push($options_proficiency, $option);
+ $option=new stdClass();
+ $option->value='yes';
+ $option->label=get_string('yes');
+ if ( $form_proficiency == 'yes' ) { $option->selected="selected"; }
+ array_push($options_proficiency, $option);
$form_review = isset($_GET['review']) ? $_GET['review'] : 'all';
- echo "<label>Évaluation demandée</label><select name='review' class='custom-select mr-3'><option value='all'";
- if ( $form_review == 'all' ) { echo 'selected'; }
- echo ">Tous</option>
- <option value='no'";
- if ( $form_review == 'no' ) { echo 'selected'; }
- echo ">Non</option>
- <option value='yes'";
- if ( $form_review == 'yes' ) { echo 'selected'; }
- echo ">Oui</option>
- </select>";
+ $options_review=array();
+ $option=new stdClass();
+ $option->value='all';
+ $option->label=get_string('all');
+ if ( $form_review == 'all' ) { $option->selected="selected"; }
+ array_push($options_review, $option);
+ $option=new stdClass();
+ $option->value='no';
+ $option->label=get_string('no');
+ if ( $form_review == 'no' ) { $option->selected="selected"; }
+ array_push($options_review, $option);
+ $option=new stdClass();
+ $option->value='yes';
+ $option->label=get_string('yes');
+ if ( $form_review == 'yes' ) { $option->selected="selected"; }
+ array_push($options_review, $option);
- echo "<button type='submit' class='btn btn-primary'>Chercher</button>";
- echo "</form>";
-
- echo "</div>";
- echo "</div>"; /* Fin filtres. */
-
- /* ===== STUDENT LIST ===== */
/* NB : un étudiant n'existe pas en base competency_usercompcourse tant que personne n'a accédé à une page de compétence le concernant. */
@@ -252,7 +212,7 @@ if (count($course_cpts) === 0) {
$params[] = $courseid;
$params = array_merge($params, $params_stud_ids);
$params[] = $current_cpt->id;
- $course_cpts = $DB->get_records_sql($sql, $params);
+ $course_cpts_all = $DB->get_records_sql($sql, $params);
$cpt_studs = array();
foreach ($students as $student) {
@@ -263,7 +223,7 @@ if (count($course_cpts) === 0) {
$cpt_stud->proficiency = NULL;
$cpt_stud->grade = NULL;
$cpt_stud->review = NULL;
- foreach ($course_cpts as $course_cpt) {
+ foreach ($course_cpts_all as $course_cpt) {
if ( $course_cpt->userid == $student->id ) {
$cpt_stud->proficiency = $course_cpt->proficiency;
$cpt_stud->grade = $course_cpt->grade;
@@ -309,57 +269,45 @@ if (count($course_cpts) === 0) {
});
}
- echo "<div class='row'>"; /* Début student list. */
- echo "<div class='col-12' style='padding: 0;'>";
- if ( count($cpt_studs) == 0 ) {
- echo "<div class='alert alert-warning'>Aucun étudiant ne correspond à la sélection. </div>";
- } else {
+ if ( count($cpt_studs) > 0 ) {
foreach ($cpt_studs as $cpt_stud) {
- $proficient_class = $cpt_stud->proficiency == 1 ? " list-group-item-success" : "";
- $grade_d = $cpt_stud->grade == NULL ? "-" : $current_cpt->scale[$cpt_stud->grade - 1];
- $proficiency_d = $cpt_stud->proficiency == 1 ? "Oui" : "Non";
- echo "
- <a href='{$CFG->wwwroot}/blocks/competency_iena/course_competency.php?courseid={$courseid}&studentid={$cpt_stud->id}&competencyid={$current_cpt->id}' class='list-group-item list-group-item-action{$proficient_class}'>
- <div class='d-flex w-100 justify-content-between'>
- <h3 class='mb-1 iena-cpt-action-title h5'>{$cpt_stud->firstname} {$cpt_stud->lastname}</h3>";
- if ($cpt_stud->review == 1) {
- echo "<div><small class='review-badge'>Évaluation demandée</small></div>";
- }
- echo "</div>
- <p class='small' style='margin-bottom: 0;'>Évaluation : {$grade_d} / Acquis : {$proficiency_d}</p>
- </a>";
+ $cpt_stud->proficient_class = $cpt_stud->proficiency == 1 ? " list-group-item-success" : "";
+ $cpt_stud->grade_d = $cpt_stud->grade == NULL ? "-" : $current_cpt->scale[$cpt_stud->grade - 1];
+ $cpt_stud->proficiency_d = $cpt_stud->proficiency == 1 ? get_string("yes") : get_string("no");
+
+ $data["link_cpt"]=$CFG->wwwroot."/blocks/competency_iena/course_competency.php?courseid=".$courseid."&studentid=".$cpt_stud->id."&competencyid=".$current_cpt->id;
+
}
+ $data["cpt_studs"]=$cpt_studs;
}
- echo "</div>";
- echo "</div>"; /* Fin student list. */
-
} else {
/* if all filters are not set ( ! isset GET... ) dont display the stud list */
}
-
- echo "</div>"; /* Fin du container bootstrap. */
+ $data["count_course_cpts"]=count($course_cpts);
+ $data["link_switch_cpt"]=$CFG->wwwroot."/blocks/competency_iena/competency_iena_competency_students_2.php";
+ $data["courseid"]=$courseid;
+ $data["grade"]=$grade;
+ $data["proficiency"]=$grade;
+ $data["review"]=$grade;
+ $data["current_cpt"]=$current_cpt;
+ $data['course_cpts']=array_values($course_cpts);
+ $data['chart_proficiency']= $OUTPUT->render($chart_proficiency);
+ $data['chart_assess']= $OUTPUT->render($chart_assess);
+ $data['reviews_count']= $reviews_count;
+ $data['link_filter']=$CFG->wwwroot."/blocks/competency_iena/competency_iena_competency_students_2.php#dash-container";
+ $data["options_grade"]=$options_grade;
+ $data["options_proficiency"]=$options_proficiency;
+ $data["options_review"]=$options_review;
+
+ $renderer = $PAGE->get_renderer('block_competency_iena');
- /* L'état des compétences du cours pour un utilisateur */
- // $user_course_competencies = \core_competency\api::list_user_competencies_in_course($COURSE->id, 4);
- // $user_course_competencies = \core_competency\api::get_user_competency_in_course($COURSE->id, 4, 1);
-
-
-
-
- /* ATTENTION : pour les deux vues */
-
- /* ATTENTION : Les reviews demandées à lister, voire dans l'api list_user_competencies_to_review ou trouver si c'est dans l'objet de base */
-
- /* ATTENTION : la compétence dans l'absolut versus dans le cours : ça apparait où ??? */
-
- /* list_course_modules_using_competency */
- /* list_course_module_competencies_in_course_module */
- /* list_course_module_competencies */
+ $renderer->get_dashboard_competency($data);
echo $OUTPUT->footer();
-}
\ No newline at end of file
+}
+
diff --git a/js/dropdown.js b/js/dropdown.js
index 88f5cc1..b470b92 100644
--- a/js/dropdown.js
+++ b/js/dropdown.js
@@ -133,7 +133,7 @@
}
if (document.getElementById('competency_list') !== null) {
- var opts = document.getElementById('competency_list').childNodes;
+ var opts = document.getElementById('competency_list').getElementsByClassName('iena-drop-item');
var competencyid = document.getElementById('competencyid').innerHTML;
for (var i = 0; i < opts.length; i++) {
if (opts[i].dataset.value === competencyid) {
@@ -144,7 +144,9 @@
} else {
document.getElementById('prevCpt').dataset.prev = prev;
document.getElementById('prevCpt').onclick = function () {
+
document.getElementById('competencyid_sel').value = document.getElementById('prevCpt').dataset.prev;
+ console.log(document.getElementById('competencyid_sel').value);
}
}
if (next === false) {
@@ -153,6 +155,7 @@
document.getElementById('nextCpt').dataset.next = next;
document.getElementById('nextCpt').onclick = function () {
document.getElementById('competencyid_sel').value = document.getElementById('nextCpt').dataset.next;
+ console.log(document.getElementById('competencyid_sel').value);
}
}
}
diff --git a/lang/en/block_competency_iena.php b/lang/en/block_competency_iena.php
index 60f27a6..806d7f6 100644
--- a/lang/en/block_competency_iena.php
+++ b/lang/en/block_competency_iena.php
@@ -88,4 +88,8 @@
$string['no_competency_description'] = 'This competency doesn\'t have a description' ;
$string['error_delete']="The activity/resource couldn't be deleted: ";
$string['dashboard_students']="Students dashboard";
+ $string['dashboard_competencies']="Competencies dashboard";
+ $string['not_assessed']="Not assessed";
+ $string['validated_competencies']="Students who validated the competency";
+ $string['assessments']="Assessments";
?>
\ No newline at end of file
diff --git a/lang/fr/block_competency_iena.php b/lang/fr/block_competency_iena.php
index ec5de61..6a4bb6c 100644
--- a/lang/fr/block_competency_iena.php
+++ b/lang/fr/block_competency_iena.php
@@ -87,6 +87,10 @@
$string['no_competency_description'] = 'Cette compétence n\'a pas de description.';
$string['error_delete']="L'activité/ressource n'a pas pu être supprimée :";
$string['dashboard_students']="Tableau de bord étudiants";
+ $string['dashboard_competencies']="Tableau de bord compétences";
+ $string['not_assessed']="Non évalués";
+ $string['validated_competencies']="Étudiants ayant validé la compétence";
+ $string['assessments']="Évaluations";
diff --git a/renderer.php b/renderer.php
index ffc5574..a0fc081 100644
--- a/renderer.php
+++ b/renderer.php
@@ -79,4 +79,8 @@ class block_competency_iena_renderer extends plugin_renderer_base {
function get_dashboard_students($data){
echo $this->render_from_template('block_competency_iena/dashboard_students', $data);
}
+
+ function get_dashboard_competency($data){
+ echo $this->render_from_template('block_competency_iena/dashboard_competencies', $data);
+ }
}
diff --git a/styles.css b/styles.css
index 4c34657..1969ffe 100644
--- a/styles.css
+++ b/styles.css
@@ -274,7 +274,7 @@ table.dataTable{
min-width: 355px;
}
-.chart-area{
+.iena-chart-unique .chart-area{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
@@ -282,11 +282,11 @@ table.dataTable{
}
-.chart-image, .chart-table{
+.iena-chart-unique .chart-image, .chart-table{
flex-grow: 1;
}
-.chart-image{
+.iena-chart-unique .chart-image{
max-width: 40%;
}
@@ -315,4 +315,5 @@ table.dataTable{
.iena-label-assess{
font-weight: bold;
margin-right: 20px;
-}
\ No newline at end of file
+}
+
diff --git a/templates/dashboard_competencies.mustache b/templates/dashboard_competencies.mustache
index 0ec5d8d..52eb971 100644
--- a/templates/dashboard_competencies.mustache
+++ b/templates/dashboard_competencies.mustache
@@ -1 +1,92 @@
-<h1></h1>
\ No newline at end of file
+<h2>{{# str }} dashboard_competencies, block_competency_iena{{/ str }}</h2>
+{{#count_course_cpts}}
+ <div class='container-fluid' id='dash-container'>
+ <div class='alert row' style='padding: 0; background-color: inherit; color: inherit;'>
+ <div class='col-12' style='padding-left: 0;'>
+ <form action='{{link_switch_cpt}}' id='change_cpt_form' class='form-inline' autocomplete='off' style='display: block;height: 1.5rem;'>
+ <input type='text' hidden name='courseid' value='{{courseid}}'>
+ {{#grade}}
+ <input type='text' hidden name='grade' value='{{grade}}'>
+ {{/grade}}
+ {{#proficiency}}
+ <input type='text' hidden name='proficiency' value='{{proficiency}}'>
+ {{/proficiency}}
+ {{#review}}
+ <input type='text' hidden name='review' value='{{review}}'>
+ {{/review}}
+ <span hidden id='competencyid'>{{current_cpt.id}}</span>
+ <div id='student_dropdown' class='iena-dropdown' style='z-index: 1;'>
+ <input type='text' hidden name='competencyid' id='competencyid_sel' class='iena-drop-input-value' value=''>
+ <input type='text' value='' class='form-control iena-drop-input' style='font-size: .7rem; line-height: 1; width: 300px;' placeholder='{{current_cpt.shortname}}' autocomplete='nope'><button class='btn btn-secondary' id='prevCpt' style='font-size: .8rem;line-height: 1.09; margin-left: 0.5rem;'>Précédent</button><button class='btn btn-secondary' id='nextCpt' style='font-size: .8rem;line-height: 1.09; margin-left: 0.5rem;'>Suivant</button>
+ <div class='iena-droplist' id='competency_list'>
+ {{#course_cpts}}
+ <a href='#' data-value='{{id}}' class='iena-drop-item' style='display: none;'>{{shortname}}</a>
+ {{/course_cpts}}
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ <div class='alert alert-secondary row' style='padding-top: 1.5rem;'>
+ <div class='col-12 col-lg-6'>
+ <h2 class='h4'>{{#str}} validated_competencies, block_competency_iena {{/str}}</h2>
+ {{{chart_proficiency}}}
+ </div>
+ <div class='col-12 col-lg-6'>
+ <h2 class='h4'>{{#str}} assessments, block_competency_iena {{/str}}</h2>
+ {{{chart_assess}}}
+ </div>
+
+ </div>
+ <div class='row'>
+ <div >
+ <h2 class='h4'>Demandes d'évaluations <span class='badge badge-pill badge-primary' style=' border-radius: 0.15rem;'>{{reviews_count}}</span></h2>
+ <form action='{{link_filter}}' class='form-inline'>
+ <input type='text' hidden name='courseid' value='{{courseid}}'>
+ <input type='text' hidden name='competencyid' value='{{current_cpt.id}}'>
+ <label>Évaluation</label>
+ <select name='grade' class='custom-select mr-3'>
+ {{#options_grade}}
+ <option value="{{value}}" {{selected}}>{{label}}</option>
+ {{/options_grade}}
+ </select>
+ <label>Validé</label>
+
+ <select name='proficiency' class='custom-select mr-3'>
+ {{#options_proficiency}}
+ <option value="{{value}}" {{selected}}>{{label}}</option>
+ {{/options_proficiency}}
+ </select>
+ <label>Évaluation demandée</label>
+ <select name='review' class='custom-select mr-3'>
+ {{#options_review}}
+ <option value="{{value}}" {{selected}}>{{label}}</option>
+ {{/options_review}}
+ </select>
+ <button type='submit' class='btn btn-primary'>Chercher</button>
+ </form>
+ </div>
+ </div>
+ <div class='row'>
+ <div class='col-12' style='padding: 0;'>
+ {{#cpt_studs}}
+ <a href='{{link_cpt}}' class='list-group-item list-group-item-action{{proficient_class}}'>
+ <div class='d-flex w-100 justify-content-between'>
+ <h3 class='mb-1 iena-cpt-action-title h5'>{{firstname}} {{lastname}}</h3>
+ {{#cpt_studs.review}}
+ <div><small class='review-badge'>Évaluation demandée</small></div>
+ {{/cpt_studs.review}}
+ </div>
+ <p class='small' style='margin-bottom: 0;'>Évaluation : {{grade_d}} / Acquis : {{proficiency_d}}</p>
+ </a>
+ {{/cpt_studs}}
+ {{^cpt_studs}}
+ <div class='alert alert-warning'>Aucun étudiant ne correspond à la sélection. </div>
+ {{/cpt_studs}}
+ </div>
+ </div>
+ </div>
+{{/count_course_cpts}}
+{{^count_course_cpts}}
+<p class='alert alert-warning'>Pour le moment, aucune compétence n'a été liée à ce cours. Pour lier des compétences au cours et les associer à des activités, rendez-vous dans la page <a href='{$CFG->wwwroot}/blocks/competency_iena/competency_iena_competencies_mgmt.php?courseid={$courseid}'>Gestion des compétences</a>. </p>
+{{/count_course_cpts}}
\ No newline at end of file
diff --git a/templates/dashboard_students.mustache b/templates/dashboard_students.mustache
index 43c2bac..a3c0660 100644
--- a/templates/dashboard_students.mustache
+++ b/templates/dashboard_students.mustache
@@ -1,9 +1,9 @@
<h2>{{# str }} dashboard_students, block_competency_iena{{/ str }}</h2>
{{#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'>
-
+ <div class='alert row' style='padding: 0; background-color: inherit; color: inherit;'>
+ <div class='col-12' style='padding-left: 0;'>
+
<!--<h2 class='h3'>{{student.firstname}} {{student.lastname}}</h2>-->
{{#is_not_student}}
@@ -23,76 +23,81 @@
{{/is_not_student}}
</div>
- <div class='col-12'>
- <h2 class='h4'>Compétences validées</h2>
+ </div>
+ <div class='alert alert-secondary row' style='padding-top: 1.5rem;'>
+
+ <div class='col-12'>
+ <h2 class='h4'>Compétences validées</h2>
+ <div class="iena-chart-unique">
{{{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}}
- <div 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'>
+ </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}}
- <h3 class='mb-1 iena-cpt-action-title h5'>{{shortname}}</h3>
-
+ <div 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'>
- <div class="iena-right-competency">
- {{#review_asked}}
- <div><small class='review-badge'>Évaluation demandée</small></div>
- {{/review_asked}}
- <div class="user-competency-actions">
- {{#is_not_student}}<a href="#" data-toggle='modal' data-target='#modal-assess-{{id}}' class="action-icon" title="Evaluer" aria-label="Evaluation"><i class="icon fa fa-file-text-o fa-fw " aria-hidden="true"></i></a>
- {{/is_not_student}}
- <a href="{{link}}" class="action-icon" title="Détails" aria-label="{{#str}} eval, block_competency_iena {{/str}}"><i class="icon fa fa-search-plus fa-fw " aria-hidden="true"></i></a>
- </div>
+ <h3 class='mb-1 iena-cpt-action-title h5'>{{shortname}}</h3>
+
+
+ <div class="iena-right-competency">
+ {{#review_asked}}
+ <div><small class='review-badge'>Évaluation demandée</small></div>
+ {{/review_asked}}
+ <div class="user-competency-actions">
+ {{#is_not_student}}<a href="#" data-toggle='modal' data-target='#modal-assess-{{id}}' class="action-icon" title="Evaluer" aria-label="Evaluation"><i class="icon fa fa-file-text-o fa-fw " aria-hidden="true"></i></a>
+ {{/is_not_student}}
+ <a href="{{link}}" class="action-icon" title="Détails" aria-label="{{#str}} eval, block_competency_iena {{/str}}"><i class="icon fa fa-search-plus fa-fw " aria-hidden="true"></i></a>
</div>
+ </div>
- </div>
- <p class='small' style='margin-bottom: 0;'>
- Évaluation : <span class="iena-label-assess">{{eval}}</span>
- Acquis : <span class="iena-label-assess">{{proficient_str}}</span> </p>
</div>
- <div class='modal fade' id="modal-assess-{{id}}" tabindex='-1' role='dialog' aria-labelledby='exampleModalScrollableTitle' aria-hidden='true'>
- <div class='modal-dialog modal-dialog-scrollable modal-dialog-centered' role='document'>
- <div class='modal-content'>
- <div class='modal-header'>
- <h5 class='modal-title'>{{#str}} eval, block_competency_iena {{/str}}</h5>
- <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button>
- </div>
- <div class='modal-body'>
- <form method='post' action='{{link_dashboard}}?courseid={{courseid}}&studentid={{student.studentid}}&competencyid={{id}}'>
- <div class='form-group'><div class='form-group'>
- <label>Évaluation</label>
- <select name='grade' class='form-control'>
- {{#scale}}
- <option value='{{value}}'{{selected}}>{{title}}</option>
- {{/scale}}
- </select>
- </div>
- <div class='form-group'>
- <textarea name='note' class='form-control' placeholder="Commentaire d'évaluation"></textarea>
- </div>
- <button type='submit' class='btn btn-primary'>Évaluer</button>
- </form>
-
+ <p class='small' style='margin-bottom: 0;'>
+ Évaluation : <span class="iena-label-assess">{{eval}}</span>
+ Acquis : <span class="iena-label-assess">{{proficient_str}}</span> </p>
+ </div>
+ <div class='modal fade' id="modal-assess-{{id}}" tabindex='-1' role='dialog' aria-labelledby='exampleModalScrollableTitle' aria-hidden='true'>
+ <div class='modal-dialog modal-dialog-scrollable modal-dialog-centered' role='document'>
+ <div class='modal-content'>
+ <div class='modal-header'>
+ <h5 class='modal-title'>{{#str}} eval, block_competency_iena {{/str}}</h5>
+ <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button>
+ </div>
+ <div class='modal-body'>
+ <form method='post' action='{{link_dashboard}}?courseid={{courseid}}&studentid={{student.studentid}}&competencyid={{id}}'>
+ <div class='form-group'><div class='form-group'>
+ <label>Évaluation</label>
+ <select name='grade' class='form-control'>
+ {{#scale}}
+ <option value='{{value}}'{{selected}}>{{title}}</option>
+ {{/scale}}
+ </select>
+ </div>
+ <div class='form-group'>
+ <textarea name='note' class='form-control' placeholder="Commentaire d'évaluation"></textarea>
+ </div>
+ <button type='submit' class='btn btn-primary'>Évaluer</button>
+ </form>
+
- </div>
</div>
</div>
</div>
</div>
- {{/user_course_competencies}}
</div>
+ {{/user_course_competencies}}
</div>
</div>
</div>
+</div>
--
GitLab