Learnpath: add option to define a specific time for abusive time registring in LP items - refs BT#21501

pull/5610/head
NicoDucou 1 year ago
parent 2f816642b8
commit e256dff020
  1. 4
      main/install/configuration.dist.php
  2. 4
      main/lp/learnpathItem.class.php

@ -2555,3 +2555,7 @@ INSERT INTO extra_field_options (field_id, option_value, display_text, priority,
// 'use_course_logo_in_course_page' is not set or there is no logo for that // 'use_course_logo_in_course_page' is not set or there is no logo for that
// course. Recommended e-mail logo width is 540px. // course. Recommended e-mail logo width is 540px.
//$_configuration['email_logo'] = false; //$_configuration['email_logo'] = false;
// Define the maximum time in seconds to be registered if no action by user in the LP for more than the php session lifetime.
//$_configuration['time_to_be_registered_for_abusiveTime'] = 600;

@ -1750,6 +1750,10 @@ class learnpathItem
if (!Tracking::minimumTimeAvailable(api_get_session_id(), api_get_course_int_id())) { if (!Tracking::minimumTimeAvailable(api_get_session_id(), api_get_course_int_id())) {
$fixedAddedMinute = 5 * 60; // Add only 5 minutes $fixedAddedMinute = 5 * 60; // Add only 5 minutes
$defaultTimeAdded = api_get_configuration_value('time_to_be_registered_for_abusiveTime');
if (!empty($defaultTimeAdded)) {
$fixedAddedMinute = $defaultTimeAdded;
}
if ($time > $sessionLifetime) { if ($time > $sessionLifetime) {
if (api_get_setting('server_type') === 'test') { if (api_get_setting('server_type') === 'test') {
error_log("fixAbusiveTime: Total time is too big: $time replaced with: $fixedAddedMinute"); error_log("fixAbusiveTime: Total time is too big: $time replaced with: $fixedAddedMinute");

Loading…
Cancel
Save