Commit 1f3aa041 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

Fix css student progress, section progress and added two filtering options for the array

parent f501b556
......@@ -34,7 +34,7 @@ class course_format_iena_completion {
* @return type
*/
public static function get_completion_by_section($section_names, $idSection) {
global $COURSE, $USER, $DB, $CFG;
$completion = new \completion_info($COURSE);
......@@ -94,7 +94,9 @@ class course_format_iena_completion {
$total_modules += count($inner_modules);
array_push($sections, $section);
}
if($total_modules==0){
return false;
}
$progress = new StdClass();
$progress->total = number_format( 100 * $total_completed / $total_modules, 0);
$progress->sections = $sections;
......
......@@ -31,6 +31,7 @@
require_once($CFG->libdir . '/completionlib.php');
require_once('entity/course_format_iena_section_ressources.php');
require_once('entity/course_format_iena_sections.php');
require_once('entity/course_format_iena_completion.php');
require_once('entity/course_format_iena_cron_action.php');
require_once('entity/course_format_iena_groups.php');
require_once('entity/course_format_iena_attendance.php');
......
......@@ -142,7 +142,7 @@ class format_iena_renderer extends format_topics_renderer{
protected function get_section_header($section, $course, $onsectionpage, $mods, $sectionreturn = null, $iena = false, $groups=false){
global $PAGE, $CFG, $COURSE, $USER;
$section_entity = new course_format_iena_sections();
$completion_entity = new course_format_iena_completion();
$o = '';
$currenttext = '';
$sectionstyle = '';
......@@ -243,6 +243,15 @@ class format_iena_renderer extends format_topics_renderer{
}
}
else{
//On va chercher la progression pour la section
$section_progress=$completion_entity->get_completion_by_section([$section->name], [$section->id]);
if($section_progress){
$section->section_progress=$section_progress->total;
}
}
......
......@@ -224,6 +224,12 @@ ul.nav.navbar-nav.ml-auto {
font-weight: 400;
}
.label_item.sect-date.prog{
background-color:#40aca3;
font-weight: bold;
color: white;
}
.iena-description {
background: #EEE;
color: #323232;
......@@ -695,6 +701,7 @@ th.th-rotate > div > span {
.section-progress span.icon-progress::after, .iena-progress-legend span.icon-progress::after{
font-size: small;
line-height: 1rem!important;
}
......@@ -826,7 +833,7 @@ tbody th{
}
#caption-iena .icon-progress::after{
line-height: 24px;
}
.iena-icon-distance, .iena-icon-presence{
......
......@@ -35,6 +35,9 @@
</a>
{{/link_suivi}}
{{#section_progress}}
<div class="label_item sect-date prog" >{{section_progress}}%</div>
{{/section_progress}}
</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