Browse Source

Fixes after merge with 1.11.x

Julio Montoya 5 years ago
parent
commit
a6fab1c871

+ 14 - 39
main/exercise/exercise_show.php

@@ -16,7 +16,7 @@ use ChamiloSession as Session;
  * @todo small letters for table variables
  */
 require_once __DIR__.'/../inc/global.inc.php';
-$debug = false;
+
 $origin = api_get_origin();
 $currentUserId = api_get_user_id();
 $printHeaders = $origin === 'learnpath';
@@ -67,7 +67,7 @@ if (empty($exerciseResult)) {
 if (empty($choiceDegreeCertainty)) {
     $choiceDegreeCertainty = isset($_REQUEST['choiceDegreeCertainty']) ? $_REQUEST['choiceDegreeCertainty'] : null;
 }
-$questionId = isset($_REQUEST['questionId']) ? $_REQUEST['questionId'] : null;
+$questionId = isset($_REQUEST['questionId']) ? (int) $_REQUEST['questionId'] : null;
 
 if (empty($choice)) {
     $choice = isset($_REQUEST['choice']) ? $_REQUEST['choice'] : null;
@@ -309,29 +309,24 @@ if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLa
 }
 
 $i = $totalScore = $totalWeighting = 0;
-if ($debug > 0) {
-    error_log("ExerciseResult: ".print_r($exerciseResult, 1));
-    error_log("QuestionList: ".print_r($questionList, 1));
-}
-
 $arrques = [];
 $arrans = [];
-$user_restriction = $is_allowedToEdit ? '' : "AND user_id=".intval($student_id)." ";
+$user_restriction = $is_allowedToEdit ? '' : " AND user_id= $student_id ";
 $sql = "SELECT attempts.question_id, answer
         FROM $TBL_TRACK_ATTEMPT as attempts
-        INNER JOIN ".$TBL_TRACK_EXERCISES." AS stats_exercises
-        ON stats_exercises.exe_id=attempts.exe_id
+        INNER JOIN $TBL_TRACK_EXERCISES AS stats_exercises
+        ON stats_exercises.exe_id = attempts.exe_id
         INNER JOIN $TBL_EXERCISE_QUESTION AS quizz_rel_questions
         ON
             quizz_rel_questions.exercice_id=stats_exercises.exe_exo_id AND
             quizz_rel_questions.question_id = attempts.question_id AND
             quizz_rel_questions.c_id=".api_get_course_int_id()."
-        INNER JOIN ".$TBL_QUESTIONS." AS questions
+        INNER JOIN $TBL_QUESTIONS AS questions
         ON
             questions.id = quizz_rel_questions.question_id AND
             questions.c_id = ".api_get_course_int_id()."
         WHERE
-            attempts.exe_id = ".$id." $user_restriction
+            attempts.exe_id = $id $user_restriction
 		GROUP BY quizz_rel_questions.question_order, attempts.question_id";
 $result = Database::query($sql);
 $question_list_from_database = [];
@@ -548,15 +543,13 @@ foreach ($questionList as $questionId) {
                     $overlap_color = 'red';
                 }
 
+                $missing_color = 'red';
                 if ($missing_color) {
                     $missing_color = 'green';
-                } else {
-                    $missing_color = 'red';
                 }
+                $excess_color = 'red';
                 if ($excess_color) {
                     $excess_color = 'green';
-                } else {
-                    $excess_color = 'red';
                 }
 
                 if (!is_numeric($final_overlap)) {
@@ -648,9 +641,9 @@ foreach ($questionList as $questionId) {
                     echo '<p>'.$comment.'</p>';
                 }
 
-                //showing the score
-                $queryfree = "SELECT marks from ".$TBL_TRACK_ATTEMPT." 
-                              WHERE exe_id = ".intval($id)." AND question_id= ".intval($questionId);
+                // Showing the score
+                $queryfree = "SELECT marks FROM $TBL_TRACK_ATTEMPT 
+                              WHERE exe_id = $id AND question_id= ".intval($questionId);
                 $resfree = Database::query($queryfree);
                 $questionScore = Database::result($resfree, 0, "marks");
                 $totalScore += $questionScore;
@@ -738,7 +731,7 @@ foreach ($questionList as $questionId) {
                 $url_name = get_lang('EditCommentsAndMarks');
             } else {
                 $url_name = get_lang('AddComments');
-                if ($action == 'edit') {
+                if ($action === 'edit') {
                     $url_name = get_lang('EditIndividualComment');
                 }
             }
@@ -842,24 +835,6 @@ foreach ($questionList as $questionId) {
                 }
 
                 $formMark->display();
-
-                /*echo '<form name="smarksform_'.$questionId.'" method="post" action="">';
-                echo get_lang('AssignMarks');
-                echo "&nbsp;<select name='marks' id='select_marks_".$questionId."' class='selectpicker exercise_mark_select'>";
-
-                if (empty($model)) {
-                    for ($i = 0; $i <= $questionWeighting; $i++) {
-                        echo '<option value="'.$i.'" '.(($i == $questionScore) ? "selected='selected'" : '').'>'.$i.'</option>';
-                    }
-                } else {
-                    foreach ($model['score_list'] as $item) {
-                        $i = api_number_format($item['score_to_qualify'] / 100 * $questionWeighting, 2);
-                        $model = ExerciseLib::getModelStyle($item, $i);
-                        echo '<option class = "'.$item['css_class'].'" value="'.$i.'" '.(($i == $questionScore) ? "selected='selected'" : '').'>'.$model.'</option>';
-                    }
-                }
-                echo '</select>';
-                echo '</form><br /></div>';*/
                 echo '</div>';
                 if ($questionScore == -1) {
                     $questionScore = 0;
@@ -1002,7 +977,7 @@ if ($answerType != MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY) {
 
 // Total score
 $myTotalScoreTemp = $totalScore;
-if ($origin != 'learnpath' || ($origin == 'learnpath' && isset($_GET['fb_type']))) {
+if ($origin != 'learnpath' || ($origin === 'learnpath' && isset($_GET['fb_type']))) {
     if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLastAttempt) {
         $totalScoreText .= '<div class="question_row">';
         if ($objExercise->selectPropagateNeg() == 0 && $myTotalScoreTemp < 0) {

+ 0 - 2
main/gradebook/gradebook_edit_cat.php

@@ -2,8 +2,6 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Script.
- *
  * @package chamilo.gradebook
  */
 require_once __DIR__.'/../inc/global.inc.php';

+ 2 - 2
main/gradebook/lib/be/category.class.php

@@ -100,9 +100,9 @@ class Category implements GradebookItem
     {
         if (!empty($this->certificate_min_score)) {
             return $this->certificate_min_score;
-        } else {
-            return null;
         }
+
+        return null;
     }
 
     /**

+ 4 - 0
main/gradebook/lib/fe/catform.class.php

@@ -273,6 +273,10 @@ class CatForm extends FormValidator
         }
 
         $defaultCertification = 0;
+        if (!empty($this->category_object)) {
+            $defaultCertification = $this->category_object->getCertificateMinScore();
+        }
+
         if (isset($this->category_object) &&
             $this->category_object->get_parent_id() == 0
         ) {

+ 3 - 1
main/gradebook/lib/scoredisplay.class.php

@@ -21,6 +21,8 @@ class ScoreDisplay
 
     /**
      * Protected constructor - call instance() to instantiate.
+     *
+     * @param int $category_id
      */
     public function __construct($category_id = 0)
     {
@@ -55,7 +57,7 @@ class ScoreDisplay
                 foreach ($displays as $display) {
                     $data = explode('::', $display['selected_value']);
                     if (empty($data[1])) {
-                        $data[1] = "";
+                        $data[1] = '';
                     }
                     $portal_displays[$data[0]] = [
                         'score' => $data[0],

+ 0 - 1
main/inc/lib/api.lib.php

@@ -2611,7 +2611,6 @@ function api_get_session_visibility(
     }
 
     $now = time();
-
     if (empty($session_id)) {
         return 0; // Means that the session is still available.
     }

+ 73 - 15
main/inc/lib/events.lib.php

@@ -97,9 +97,35 @@ class Event
         return true;
     }
 
+    /**
+     * @param int $sessionId
+     *
+     * @return bool
+     */
+    public static function isSessionLogNeedToBeSave($sessionId)
+    {
+        if (!empty($sessionId)) {
+            $visibility = api_get_session_visibility($sessionId);
+            if (!empty($visibility) && $visibility != SESSION_AVAILABLE) {
+                $extraFieldValue = new ExtraFieldValue('session');
+                $value = $extraFieldValue->get_values_by_handler_and_field_variable(
+                    $sessionId,
+                    'disable_log_after_session_ends'
+                );
+                if (!empty($value) && isset($value['value']) && (int) $value['value'] == 1) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
     /**
      * @author Sebastien Piraux <piraux_seb@hotmail.com>
      * @desc Record information for access event for courses
+     *
+     * @return bool
      */
     public static function accessCourse()
     {
@@ -108,22 +134,26 @@ class Event
         }
 
         $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
-        //for "what's new" notification
+        // For "what's new" notification
         $TABLETRACK_LASTACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
 
-        $id_session = api_get_session_id();
+        $sessionId = api_get_session_id();
         $now = api_get_utc_datetime();
         $courseId = api_get_course_int_id();
         $userId = api_get_user_id();
         $ip = Database::escape_string(api_get_real_ip());
 
+        if (self::isSessionLogNeedToBeSave($sessionId) === false) {
+            return false;
+        }
+
         if ($userId) {
             $userId = $userId;
         } else {
-            $userId = "0"; // no one
+            $userId = '0'; // no one
         }
         $sql = "INSERT INTO $TABLETRACK_ACCESS  (user_ip, access_user_id, c_id, access_date, access_session_id) 
-                VALUES ('$ip', $userId, $courseId, '$now', $id_session)";
+                VALUES ('$ip', $userId, $courseId, '$now', $sessionId)";
 
         Database::query($sql);
 
@@ -133,16 +163,16 @@ class Event
                   access_user_id = $userId AND
                   c_id = $courseId AND 
                   access_tool IS NULL AND 
-                  access_session_id = $id_session";
+                  access_session_id = $sessionId";
         $result = Database::query($sql);
 
         if (Database::affected_rows($result) == 0) {
             $sql = "INSERT INTO $TABLETRACK_LASTACCESS (access_user_id, c_id, access_date, access_session_id)
-                    VALUES ($userId, $courseId, '$now', $id_session)";
+                    VALUES ($userId, $courseId, '$now', $sessionId)";
             Database::query($sql);
         }
 
-        return 1;
+        return true;
     }
 
     /**
@@ -182,6 +212,11 @@ class Event
         if (empty($courseInfo)) {
             return false;
         }
+
+        if (self::isSessionLogNeedToBeSave($sessionId) === false) {
+            return false;
+        }
+
         $courseId = $courseInfo['real_id'];
 
         $tableAccess = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
@@ -1989,6 +2024,12 @@ class Event
         if (Session::read('login_as')) {
             return false;
         }
+
+        $sessionId = (int) $sessionId;
+        if (self::isSessionLogNeedToBeSave($sessionId) === false) {
+            return false;
+        }
+
         $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
         $loginDate = $logoutDate = api_get_utc_datetime();
 
@@ -1996,7 +2037,6 @@ class Event
         $counter = 1;
         $courseId = (int) $courseId;
         $user_id = (int) $user_id;
-        $sessionId = (int) $sessionId;
         $ip = Database::escape_string(api_get_real_ip());
 
         $sql = "INSERT INTO $table(c_id, user_ip, user_id, login_course_date, logout_course_date, counter, session_id)
@@ -2043,9 +2083,14 @@ class Event
             return false;
         }
 
+        $sessionId = (int) $sessionId;
+
+        if (self::isSessionLogNeedToBeSave($sessionId) === false) {
+            return false;
+        }
+
         $courseId = (int) $courseId;
         $userId = (int) $userId;
-        $sessionId = (int) $sessionId;
 
         $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
         $sql = "SELECT course_access_id, logout_course_date 
@@ -2115,13 +2160,19 @@ class Event
             $sessionLifetime = 3600; // 1 hour
         }
         if (!empty($logoutInfo) && !empty($logoutInfo['cid'])) {
-            $tableCourseAccess = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
-            $userId = (int) $logoutInfo['uid'];
-            $courseId = (int) $logoutInfo['cid'];
             $sessionId = 0;
             if (!empty($logoutInfo['sid'])) {
                 $sessionId = (int) $logoutInfo['sid'];
             }
+
+            if (self::isSessionLogNeedToBeSave($sessionId) === false) {
+                return false;
+            }
+
+            $tableCourseAccess = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
+            $userId = (int) $logoutInfo['uid'];
+            $courseId = (int) $logoutInfo['cid'];
+
             $currentDate = api_get_utc_datetime();
             // UTC time
             $diff = time() - $sessionLifetime;
@@ -2356,7 +2407,14 @@ class Event
      */
     public static function registerLog($logInfo)
     {
-        if (!Tracking::minimumTimeAvailable(api_get_session_id(), api_get_course_int_id())) {
+        $sessionId = api_get_session_id();
+        $courseId = api_get_course_int_id();
+
+        if (!Tracking::minimumTimeAvailable($sessionId, $courseId)) {
+            return false;
+        }
+
+        if (self::isSessionLogNeedToBeSave($sessionId) === false) {
             return false;
         }
 
@@ -2371,8 +2429,8 @@ class Event
         $logInfo['action_details'] = !empty($logInfo['action_details']) ? $logInfo['action_details'] : '';
         $logInfo['ip_user'] = api_get_real_ip();
         $logInfo['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
-        $logInfo['session_id'] = api_get_session_id();
-        $logInfo['c_id'] = api_get_course_int_id();
+        $logInfo['session_id'] = $sessionId;
+        $logInfo['c_id'] = $courseId;
         $logInfo['ch_sid'] = session_id();
         $logInfo['login_as'] = $loginAs;
         $logInfo['info'] = !empty($logInfo['info']) ? $logInfo['info'] : '';

+ 8 - 1
main/inc/lib/exercise.lib.php

@@ -2827,6 +2827,7 @@ HOTSPOT;
             $score = $result['score'];
             $weight = $result['weight'];
         }
+
         $percentage = (100 * $score) / ($weight != 0 ? $weight : 1);
         // Formats values
         $percentage = float_format($percentage, 1);
@@ -2884,6 +2885,13 @@ HOTSPOT;
             $html = $scoreBasedInModel;
         }
 
+        // Ignore other formats and use the configuratio['exercise_score_format'] value
+        // But also keep the round values settings.
+        $format = api_get_configuration_value('exercise_score_format');
+        if (!empty($format)) {
+            $html = ScoreDisplay::instance()->display_score([ $score, $weight], $format);
+        }
+
         $html = Display::span($html, ['class' => 'score_exercise']);
 
         return $html;
@@ -5060,7 +5068,6 @@ EOT;
             $ribbon .= '<h3>'.get_lang('YourTotalScore').':&nbsp;';
             $ribbon .= self::show_score($score, $weight, false, true);
             $ribbon .= '</h3>';
-
             $ribbon .= '</div>';
         }
 

+ 12 - 10
main/lp/learnpath.class.php

@@ -2004,12 +2004,14 @@ class learnpath
     /**
      * Gets the navigation bar for the learnpath display screen.
      *
+     * @param string $barId
+     *
      * @return string The HTML string to use as a navigation bar
      */
-    public function get_navigation_bar($idBar = null, $display = null)
+    public function get_navigation_bar($barId = '')
     {
-        if (empty($idBar)) {
-            $idBar = 'control-top';
+        if (empty($barId)) {
+            $barId = 'control-top';
         }
         $lpId = $this->lp_id;
         $mycurrentitemid = $this->get_current_item_id();
@@ -2032,7 +2034,7 @@ class learnpath
 
         if (!empty($display)) {
             $showReporting = isset($display['show_reporting_icon']) ? $display['show_reporting_icon'] : true;
-            if ($showReporting == false) {
+            if ($showReporting === false) {
                 $reportingIcon = '';
             }
         }
@@ -2060,7 +2062,7 @@ class learnpath
 
         if ($this->mode === 'fullscreen') {
             $navbar = '
-                  <span id="'.$idBar.'" class="buttons">
+                  <span id="'.$barId.'" class="buttons">
                     '.$reportingIcon.'
                     '.$previousIcon.'                    
                     '.$nextIcon.'
@@ -2071,11 +2073,11 @@ class learnpath
                   </span>';
         } else {
             $navbar = '
-            <span id="'.$idBar.'" class="buttons text-right">
-                '.$reportingIcon.'
-                '.$previousIcon.'
-                '.$nextIcon.'               
-            </span>';
+                 <span id="'.$barId.'" class="buttons text-right">
+                    '.$reportingIcon.'
+                    '.$previousIcon.'
+                    '.$nextIcon.'               
+                </span>';
         }
 
         return $navbar;

+ 11 - 3
main/lp/lp_view.php

@@ -33,7 +33,6 @@ if (isset($_REQUEST['origin']) && $_REQUEST['origin'] === 'learnpath') {
 }
 
 // To prevent the template class
-$show_learnpath = true;
 $lp_id = !empty($_GET['lp_id']) ? (int) $_GET['lp_id'] : 0;
 $sessionId = api_get_session_id();
 $course_code = api_get_course_id();
@@ -169,7 +168,7 @@ if ($allowLpItemTip) {
 }
 
 // Impress js
-if ($lp->mode == 'impress') {
+if ($lp->mode === 'impress') {
     $lp_id = $lp->get_id();
     $url = api_get_path(WEB_CODE_PATH)."lp/lp_impress.php?lp_id=$lp_id&".api_get_cidreq();
     header("Location: $url");
@@ -419,7 +418,7 @@ if (!api_is_invitee()) {
     $progress_bar = $lp->getProgressBar();
 }
 $navigation_bar = $lp->get_navigation_bar();
-$navigation_bar_bottom = $lp->get_navigation_bar('control-bottom', 'display:none');
+$navigation_bar_bottom = $lp->get_navigation_bar('control-bottom');
 $mediaplayer = $lp->get_mediaplayer($lp->current, $autostart);
 
 $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
@@ -546,6 +545,15 @@ $template->assign('iframe_src', $src);
 $template->assign('navigation_bar_bottom', $navigation_bar_bottom);
 $template->assign('show_left_column', $lp->getHideTableOfContents() == 0);
 
+$showMenu = 0;
+$settings = api_get_configuration_value('lp_view_settings');
+$display = isset($settings['display']) ? $settings['display'] : false;
+if (!empty($display)) {
+    $showMenu = isset($display['show_toolbar_by_default']) && $display['show_toolbar_by_default'] ? 1 : 0;
+}
+
+$template->assign('show_toolbar_by_default', $showMenu);
+
 if ($gamificationMode == 1) {
     $template->assign('gamification_stars', $lp->getCalculateStars($sessionId));
     $template->assign('gamification_points', $lp->getCalculateScore($sessionId));

+ 105 - 3
main/mySpace/access_details_session.php

@@ -112,7 +112,10 @@ if ($form->validate()) {
 
     $sessionCategories = UserManager::get_sessions_by_category($userId, false);
     $report = [];
-    $content = '';
+    $minLogin = 0;
+    $maxLogin = 0;
+    $totalDuration = 0;
+
     foreach ($sessionCategories as $category) {
         foreach ($category['sessions'] as $session) {
             $sessionId = $session['session_id'];
@@ -127,13 +130,51 @@ if ($form->validate()) {
                     $to
                 );
 
+                $partialMinLogin = 0;
+                $partialMaxLogin = 0;
+                $partialDuration = 0;
+
                 foreach ($result as $item) {
                     $record = [
-                        //$courseInfo['title'],
                         customDate($item['login'], true),
                         customDate($item['logout'], true),
                         api_format_time($item['duration'], 'js'),
                     ];
+
+                    $totalDuration += $item['duration'];
+
+                    if (empty($minLogin)) {
+                        $minLogin = api_strtotime($item['login'], 'UTC');
+                    }
+                    if ($minLogin > api_strtotime($item['login'], 'UTC')) {
+                        $minLogin = api_strtotime($item['login'], 'UTC');
+                    }
+                    if (api_strtotime($item['logout']) > $maxLogin) {
+                        $maxLogin = api_strtotime($item['logout'], 'UTC');
+                    }
+
+                    // Partials
+                    $partialDuration += $item['duration'];
+                    if (empty($partialMinLogin)) {
+                        $partialMinLogin = api_strtotime($item['login'], 'UTC');
+                    }
+                    if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
+                        $partialMinLogin = api_strtotime($item['login'], 'UTC');
+                    }
+                    if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
+                        $partialMaxLogin = api_strtotime($item['logout'], 'UTC');
+                    }
+
+                    $report[$sessionId]['courses'][$course['real_id']][] = $record;
+                    $report[$sessionId]['name'][$course['real_id']] = $courseInfo['title'].'&nbsp; ('.$session['session_name'].')';
+                }
+
+                if (!empty($result)) {
+                    $record = [
+                        customDate($partialMinLogin, true),
+                        customDate($partialMaxLogin, true),
+                        api_format_time($partialDuration, 'js'),
+                    ];
                     $report[$sessionId]['courses'][$course['real_id']][] = $record;
                     $report[$sessionId]['name'][$course['real_id']] = $courseInfo['title'].'&nbsp; ('.$session['session_name'].')';
                 }
@@ -153,6 +194,10 @@ if ($form->validate()) {
             $to
         );
 
+        $partialMinLogin = 0;
+        $partialMaxLogin = 0;
+        $partialDuration = 0;
+
         foreach ($result as $item) {
             $record = [
                 customDate($item['login'], true),
@@ -161,15 +206,68 @@ if ($form->validate()) {
             ];
             $report[0]['courses'][$course['course_id']][] = $record;
             $report[0]['name'][$course['course_id']] = $course['title'];
+
+            $totalDuration += $item['duration'];
+
+            if (empty($minLogin)) {
+                $minLogin = api_strtotime($item['login'], 'UTC');
+            }
+            if ($minLogin > api_strtotime($item['login'], 'UTC')) {
+                $minLogin = api_strtotime($item['login'], 'UTC');
+            }
+            if (api_strtotime($item['logout'], 'UTC') > $maxLogin) {
+                $maxLogin = api_strtotime($item['logout'], 'UTC');
+            }
+
+            // Partials
+            $partialDuration += $item['duration'];
+            if (empty($partialMinLogin)) {
+                $partialMinLogin = api_strtotime($item['login'], 'UTC');
+            }
+            if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) {
+                $partialMinLogin = api_strtotime($item['login'], 'UTC');
+            }
+            if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) {
+                $partialMaxLogin = api_strtotime($item['logout'], 'UTC');
+            }
+        }
+
+        if (!empty($result)) {
+            $record = [
+                customDate($partialMinLogin, true),
+                customDate($partialMaxLogin, true),
+                api_format_time($partialDuration, 'js'),
+            ];
+
+            $report[0]['courses'][$course['course_id']][] = $record;
+            $report[0]['name'][$course['course_id']] = $course['title'];
         }
     }
 
+    $table = new HTML_Table(['class' => 'data_table']);
+    $headers = [
+        get_lang('MinStartDate'),
+        get_lang('MaxEndDate'),
+        get_lang('TotalDuration'),
+    ];
+    $row = 0;
+    $column = 0;
+    foreach ($headers as $header) {
+        $table->setHeaderContents($row, $column, $header);
+        $column++;
+    }
+    $row++;
+    $column = 0;
+    $table->setCellContents($row, $column++, customDate($minLogin));
+    $table->setCellContents($row, $column++, customDate($maxLogin));
+    $table->setCellContents($row, $column++, api_format_time($totalDuration, 'js'));
+    $content = Display::page_subheader3(get_lang('Total')).$table->toHtml();
+
     foreach ($report as $sessionId => $data) {
         foreach ($data['courses'] as $courseId => $courseData) {
             $content .= Display::page_subheader3($data['name'][$courseId]);
             $table = new HTML_Table(['class' => 'data_table']);
             $headers = [
-                //get_lang('Course'),
                 get_lang('StartDate'),
                 get_lang('EndDate'),
                 get_lang('Duration'),
@@ -181,10 +279,14 @@ if ($form->validate()) {
                 $column++;
             }
             $row++;
+            $countData = count($courseData);
             foreach ($courseData as $record) {
                 $column = 0;
                 foreach ($record as $item) {
                     $table->setCellContents($row, $column++, $item);
+                    if ($row == $countData) {
+                        $table->setRowAttributes($row, ['style' => 'font-weight:bold']);
+                    }
                 }
                 $row++;
             }

+ 0 - 2
main/search/search_suggestions.php

@@ -123,5 +123,3 @@ if (isset($_GET['term'])) {
 
     get_suggestions_from_search_engine($q);
 }
-//echo $q . "| value\n";
-get_suggestions_from_search_engine($q);

+ 2 - 3
main/session/session_edit.php

@@ -53,8 +53,8 @@ if (!empty($sessionInfo['coach_access_end_date'])) {
 
 $tool_name = get_lang('EditSession');
 
-$interbreadcrumb[] = ['url' => "session_list.php", "name" => get_lang('SessionList')];
-$interbreadcrumb[] = ['url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')];
+$interbreadcrumb[] = ['url' => 'session_list.php', 'name' => get_lang('SessionList')];
+$interbreadcrumb[] = ['url' => 'resume_session.php?id_session='.$id, 'name' => get_lang('SessionOverview')];
 
 if (isset($_POST['formSent']) && $_POST['formSent']) {
     $formSent = 1;
@@ -205,7 +205,6 @@ $form->display();
 
 <script>
 $(function() {
-
 <?php
     if (!empty($sessionInfo['duration'])) {
         echo 'accessSwitcher(0);';

+ 1 - 8
main/template/default/learnpath/view.tpl

@@ -32,8 +32,6 @@
                             #timer .container{display:table;background:#777;color:#eee;font-weight:bold;width:100%;text-align:center;text-shadow:1px 1px 4px #999;}
                             #timer .container div{display:table-cell;font-size:24px;padding:0px;width:20px;}
                             #timer .container .divider{width:10px;color:#ddd;}
-                            #btn-comenzar{box-sizing:border-box;background:#eee;border:none;margin:0 auto;padding:20px;width:100%;font-size:30px;color:#777;}
-                            #btn-comenzar:hover{background:#fff;}
                         </style>
                         <script>
                             $(function() {
@@ -42,7 +40,6 @@
                                     minute: parseInt($("#minute").text()),
                                     second:  parseInt($("#second").text())
                                 };
-                                //window.timerInterval = null;
                                 clearInterval(window.timerInterval);
                                 window.timerInterval = setInterval(function(){
                                     // Seconds
@@ -76,7 +73,6 @@
                                 </div>
                             </div>
                         </div>
-
                         <div class="row">
                             <div class="col-xs-4">
                                 <b>
@@ -91,7 +87,6 @@
                                         <div id="minute">{{ minute }}</div>
                                         <div class="divider">:</div>
                                         <div id="second">{{ second }}</div>
-
                                         <div id="slash"> / </div>
                                         <div>{{ hour_min }}</div>
                                     </div>
@@ -175,7 +170,7 @@
                     </ul>
                 </div>
                 <nav id="btn-menu-float" class="circular-menu">
-                    <div class="circle">
+                    <div class="circle {{ show_toolbar_by_default == 1 ? 'open' : '' }}">
                         {% if show_left_column == 1 %}
                             <a href="#" title = "{{ 'Expand'|get_lang }}" id="lp-view-expand-toggle"
                                class="icon-toolbar expand" role="button">
@@ -262,7 +257,6 @@
         }
 
         {% if lp_mode == 'embedframe' %}
-            //$('#learning_path_main').addClass('lp-view-collapsed');
             $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
                 e.preventDefault();
                 $('#learning_path_main').toggleClass('lp-view-collapsed');
@@ -383,7 +377,6 @@
         {% if disable_js_in_lp_view == 0 %}
             $(function() {
                 var arr = ['link', 'sco'];
-
                 if ($.inArray(olms.lms_item_type, arr) == -1) {
                     {{ frame_ready }}
                 }