Lp: Fix max or average progress from course setting - refs BT#19309

pull/4074/head
Christian 4 years ago
parent 2ae72a3581
commit 413ac1e0dd
  1. 10
      main/inc/lib/tracking.lib.php
  2. 5
      main/tracking/courseLog.php

@ -5347,7 +5347,10 @@ class Tracking
$courseId = $courseInfo['real_id']; $courseId = $courseInfo['real_id'];
if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) { if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) {
$lpShowMaxProgress = ('max' === api_get_course_setting('lp_show_max_or_average_progress', $courseInfo, true)); $lpShowProgressCourseSetting = api_get_course_setting('lp_show_max_or_average_progress', $courseInfo, true);
if (in_array($lpShowProgressCourseSetting, ['max', 'average'])) {
$lpShowMaxProgress = ('max' === $lpShowProgressCourseSetting);
}
} }
$total_time_login = self::get_time_spent_on_the_course( $total_time_login = self::get_time_spent_on_the_course(
@ -8983,7 +8986,10 @@ class TrackingCourseLog
$lpShowMaxProgress = api_get_configuration_value('lp_show_max_progress_instead_of_average'); $lpShowMaxProgress = api_get_configuration_value('lp_show_max_progress_instead_of_average');
if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) { if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) {
$lpShowMaxProgress = ('max' === api_get_course_setting('lp_show_max_or_average_progress', $courseInfo, true)); $lpShowProgressCourseSetting = api_get_course_setting('lp_show_max_or_average_progress', $courseInfo, true);
if (in_array($lpShowProgressCourseSetting, ['max', 'average'])) {
$lpShowMaxProgress = ('max' === $lpShowProgressCourseSetting);
}
} }
while ($user = Database::fetch_array($res, 'ASSOC')) { while ($user = Database::fetch_array($res, 'ASSOC')) {

@ -31,7 +31,10 @@ $from = isset($_GET['from']) ? $_GET['from'] : null;
$origin = api_get_origin(); $origin = api_get_origin();
$lpShowMaxProgress = api_get_configuration_value('lp_show_max_progress_instead_of_average'); $lpShowMaxProgress = api_get_configuration_value('lp_show_max_progress_instead_of_average');
if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) { if (api_get_configuration_value('lp_show_max_progress_or_average_enable_course_level_redefinition')) {
$lpShowMaxProgress = ('max' === api_get_course_setting('lp_show_max_or_average_progress')); $lpShowProgressCourseSetting = api_get_course_setting('lp_show_max_or_average_progress');
if (in_array($lpShowProgressCourseSetting, ['max', 'average'])) {
$lpShowMaxProgress = ('max' === $lpShowProgressCourseSetting);
}
} }
// Starting the output buffering when we are exporting the information. // Starting the output buffering when we are exporting the information.

Loading…
Cancel
Save