Преглед на файлове

Fixing time spent on LMS to set it from the begining and not only last 7 days -refs BT#11031

Nicolas Ducoulombier преди 8 години
родител
ревизия
bb8c4bc57e
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      main/mySpace/works_in_session_report.php

+ 2 - 1
main/mySpace/works_in_session_report.php

@@ -41,6 +41,7 @@ $usersInfo = [];
 
 if ($session) {
     $sessionCourses = $session->getCourses();
+    $today = new DateTime('now', new DateTimeZone('UTC'));
 
     foreach ($sessionCourses as $sessionCourse) {
         $course = $sessionCourse->getCourse();
@@ -55,7 +56,7 @@ if ($session) {
                     'code' => $user->getOfficialCode(),
                     'complete_name' => $user->getCompleteName(),
                     'time_in_platform' => api_time_to_hms(
-                        Tracking::get_time_spent_on_the_platform($user->getId())
+                        Tracking::get_time_spent_on_the_platform($user->getId(), 'custom', '0000:00:00', $today->format('Y-m-d H:i:s'))
                     ),
                     'first_connection' => Tracking::get_first_connection_date($user->getId()),
                     'last_connection' => Tracking::get_last_connection_date($user->getId())