From b271d1c9f96b8836fc1391dd8b64fe8b92604e26 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 18 Dec 2018 12:07:32 -0500 Subject: [PATCH] Minor - Fix comments in code from #2757 --- main/inc/lib/tracking.lib.php | 3 +-- main/inc/lib/usermanager.lib.php | 2 +- main/lp/learnpath.class.php | 25 ++++++++----------- main/lp/learnpathItem.class.php | 2 +- main/lp/lp_controller.php | 1 - main/lp/lp_list.php | 3 --- .../default/mail/content_ending_learnpath.tpl | 10 ++++---- 7 files changed, 18 insertions(+), 28 deletions(-) diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 8ac9a200ed..25106e552f 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -436,7 +436,6 @@ class Tracking $score = $row['myscore']; $time_for_total = $row['mytime']; - // ## NSR sistema de tiempos nuevo if (api_get_configuration_value('lp_minimum_time')) { $timeCourse = self::getCalculateTime($user_id, $course_id, $session_id); Session::write('trackTimeCourse', $timeCourse); @@ -1900,7 +1899,7 @@ class Tracking $courseId = $courseInfo['real_id']; if (api_get_configuration_value('lp_minimum_time')) { - // ## NSR - Muestra la última fecha que accedió a la sesión cuando estaba activa + // Show the last date on which the user acceed the session when it was active $where_condition = ''; $userInfo = api_get_user_info($student_id); if ($userInfo['status'] == 5 && $session_id > 0) { diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index fee16827ef..c0f32ec2dc 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -5975,7 +5975,7 @@ SQL; 'tool_id' => 0, 'tool_id_detail' => 0, 'action' => '', - 'info' => 'Cambia de usuario (login as)', + 'info' => 'Change user (login as)', ]; Event::registerLog($logInfo); diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 6c839452f9..8d727a8b36 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -2408,16 +2408,19 @@ class learnpath } if (api_get_configuration_value('lp_minimum_time')) { - // ## NSR - bloquear si no supera tiempo minimo - // TL --- Tiempo minimo para superar la lección ( en minutos ) + // Block if it does not exceed minimum time + // Minimum time (in minutes) to pass the learning path $accumulateWorkTime = self::getAccumulateWorkTimePrerequisite($prerequisite, $courseInfo['real_id']); if ($accumulateWorkTime > 0) { - // TT --- Tiempo total del curso + // Total time in course (sum of times in learning paths from course) $accumulateWorkTimeTotal = self::getAccumulateWorkTimeTotal($courseInfo['real_id']); - // P y TC --- Conectamos con la tabla plugin_licences_course_session en la que se indica que porcentaje del tiempo se aplica + // Connect with the plugin_licences_course_session table + // which indicates what percentage of the time applies + // Minimum connection percentage $perc = 100; + // Time from the course $tc = $accumulateWorkTimeTotal; if (!empty($sessionId) && $sessionId != 0) { /*$sql = "SELECT hours, perc FROM plugin_licences_course_session WHERE session_id = $sessionId"; @@ -2429,20 +2432,12 @@ class learnpath }*/ } - // PL --- Porcentaje lección (tiempo leccion / tiempo total curso) + // Percentage of the learning paths $pl = $accumulateWorkTime / $accumulateWorkTimeTotal; - /* - * TL: Tiempo que pone en una lección - * TT : tiempo total que pone Teresa (suma tiempos lecciones curso) - * PL: Fracción que supone una lección sobre el tiempo total = TL/TT - * TC: Tiempo que dice el cliente que tiene el curso - * P: porcentaje mínimo conexión que indica el cliente - * - * el tiempo mínimo de cada lección sería: PL x TC x P /100 - */ + // Minimum time for each learning path $accumulateWorkTime = ($pl * $tc * $perc / 100); - // Tiempo empleado hasta el momento en la leccion ( en segundos ) + // Spent time (in seconds) so far in the learning path $lpTime = Tracking::get_time_spent_in_lp( $studentId, $courseInfo['code'], diff --git a/main/lp/learnpathItem.class.php b/main/lp/learnpathItem.class.php index e391415781..5f923cd423 100755 --- a/main/lp/learnpathItem.class.php +++ b/main/lp/learnpathItem.class.php @@ -1899,7 +1899,7 @@ class learnpathItem return $time; } else { - /* ## NSR - calculo de tiempo minimo y acumulado */ + // Calulate minimum and accumulated time $user_id = api_get_user_id(); $myLP = learnpath::getLpFromSession(api_get_course_id(), $this->lp_id, $user_id); $timeLp = $myLP->getAccumulateWorkTime(); diff --git a/main/lp/lp_controller.php b/main/lp/lp_controller.php index 9c30839af2..8c7e3d0277 100755 --- a/main/lp/lp_controller.php +++ b/main/lp/lp_controller.php @@ -412,7 +412,6 @@ if ($debug > 0) { } switch ($action) { - // ## NSR case 'send_notify_teacher': // Enviar correo al profesor $studentInfo = api_get_user_info(); diff --git a/main/lp/lp_list.php b/main/lp/lp_list.php index b9dc946c45..ddefdbadea 100755 --- a/main/lp/lp_list.php +++ b/main/lp/lp_list.php @@ -398,7 +398,6 @@ foreach ($categories as $item) { } } - // ## NSR if ($progress < 100) { $ending = false; } @@ -406,7 +405,6 @@ foreach ($categories as $item) { $dsp_time = ''; $linkMinTime = ''; if (api_get_configuration_value('lp_minimum_time')) { - // ## NSR // Time info // TL --- Tiempo minimo para superar la lección ( en minutos ) $accumulateWorkTime = learnpath::getAccumulateWorkTimePrerequisite($id, api_get_course_int_id()); @@ -477,7 +475,6 @@ foreach ($categories as $item) { $time_progress_value = intval(($lpTime * 100) / ($accumulateWorkTime * 60)); } - // ## NSR if ($time_progress_value < 100) { $ending = false; } diff --git a/main/template/default/mail/content_ending_learnpath.tpl b/main/template/default/mail/content_ending_learnpath.tpl index 42564cab3f..ff60e61798 100644 --- a/main/template/default/mail/content_ending_learnpath.tpl +++ b/main/template/default/mail/content_ending_learnpath.tpl @@ -1,6 +1,6 @@ -

{{ 'Dear'|get_lang }} {{ name_teacher }},

-

El estudiante {{ name_student }} ha finalizado las lecciones del grupo {{ course_name }}

-

{{ course_url }}

+

{{ 'DearXComma'|get_lang|format(name_teacher) }}

+

{{ 'TheStudentXHasFinishedTheCourseYLessons'|get_lang|format(name_student, course_name) }}

+

{{ course_url }}

{{ 'SignatureFormula'|get_lang }}

-

{{ prefix ? prefix }}
-

+

{{ prefix ? prefix }}

+