Commit 60736b19 authored by Thomas Fradet's avatar Thomas Fradet

graph historic

parent 7813f941
......@@ -283,53 +283,76 @@ echo "</div>"; /* END evaluation info and actions row */
// OKOK
// $course_evidencies = \core_competency\api::list_evidence_in_course($studentid, $courseid, $competencyid, $sort = 'timecreated', $order = 'DESC', $skip = 0, $limit = 0);
$course_evidencies = \core_competency\api::list_evidence_in_course($studentid, $courseid, $competencyid, $sort = 'timecreated', $order = 'DESC', $skip = 0, $limit = 0);
$all_evidencies = \core_competency\api::list_evidence($studentid, $competencyid, $planid = 0, $sort = 'timecreated', $order = 'DESC', $skip = 0, $limit = 0);
// foreach ($course_evidencies as $evidence) {
// echo "<ul>";
$labels = array();
$series_data = array();
$series_data_all = array();
// echo "<li>{$evidence->get('id')}</li>";
foreach ($all_evidencies as $evidence) {
echo "<ul>";
echo "<li>{$evidence->get('id')}</li>";
// echo "<li>Action : {$evidence->get('action')} (0 : log, 2 ou 3 : rating)</li>";
// $grade = $evidence->get('grade');
echo "<li>Action : {$evidence->get('action')} (0 : log, 2 ou 3 : rating)</li>";
$grade = $evidence->get('grade');
// if ( $grade != NULL ) { /* liéer à descidentifier == evidence_manualoverrideincourse ??? */
// $grade_label = $cpt_scale[$grade - 1];
// echo "<li>{$grade_label}</li>";
// }
if ( $grade != NULL ) { /* liéer à descidentifier == evidence_manualoverrideincourse ??? */
$grade_label = $cpt_scale[$grade - 1];
echo "<li>{$grade_label}</li>";
if ( $evidence->get('contextid') == $context->__get('id') ) {
$series_data[] = $grade;
$series_data_all[] = 0;
} else {
$series_data[] = 0;
$series_data_all[] = $grade;
}
$labels[] = userdate($evidence->get('timecreated'), "%d/%m/%y");
} else {
}
// // evidence_manualoverride
// // evidence_manualoverrideinplan
// // evidence_manualoverrideincourse
// $evidence_type = $evidence->get('descidentifier');
// if ( $evidence_type == 'evidence_manualoverrideincourse' ) {
// $emitter = user_get_users_by_id([$evidence->get('actionuserid')])[$evidence->get('actionuserid')];
// echo "<li>{$emitter->firstname} {$emitter->lastname}</li>";
// } elseif ( $evidence_type == 'evidence_coursemodulecompleted' ) {
// echo "<li>{$evidence->get('desca')}</li>";
// }
// evidence_manualoverride
// evidence_manualoverrideinplan
// evidence_manualoverrideincourse
$evidence_type = $evidence->get('descidentifier');
if ( $evidence_type == 'evidence_manualoverrideincourse' ) {
$emitter = user_get_users_by_id([$evidence->get('actionuserid')])[$evidence->get('actionuserid')];
echo "<li>{$emitter->firstname} {$emitter->lastname}</li>";
} elseif ( $evidence_type == 'evidence_coursemodulecompleted' ) {
echo "<li>{$evidence->get('desca')}</li>";
}
// var_dump($evidence->get_description()->out());
var_dump($evidence->get_description()->out());
// echo "</ul>";
// }
echo "</ul>";
}
// echo "<pre>";
// var_dump($course_evidencies);
// echo "</pre>";
echo "<pre>";
// var_dump($context->__get('id'));
// var_dump($all_evidencies);
// var_dump($series_data);
// var_dump($series_data_all);
// var_dump($labels);
echo "</pre>";
// OK OK END
echo "<div class='alert alert-secondary'>";
$labels = ["Un", "Deux", "Trois"];
$series_data = [1, 2, 3];
_html('h2', "Historique d'évaluation", "h3");
$chart = new core\chart_bar();
$series = new core\chart_series('', $series_data);
// $chart->get_yaxis(0, true)->set_label("I'm the label for Y");
$chart->get_yaxis(0, true)->set_labels(["Non évaluant", "Non compétent", "Compétent"]);
$series = new core\chart_series('Donnée dans ce cours', array_reverse($series_data));
$series_all = new core\chart_series("Donnée dans d'autres cours", array_reverse($series_data_all));
$chart->add_series($series);
$chart->set_labels($labels);
$chart->add_series($series_all);
$chart->set_labels(array_reverse($labels));
echo $OUTPUT->render($chart);
echo "</div>";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment