Lps: Fix lp stats

pull/3844/head
Julio Montoya 5 years ago
parent 0fd2f55772
commit 35747bd48f
  1. 370
      public/main/inc/lib/tracking.lib.php
  2. 1
      public/main/lp/learnpath.class.php
  3. 12
      public/main/lp/learnpathItem.class.php
  4. 23
      public/main/lp/lp_stats.php

File diff suppressed because it is too large Load Diff

@ -9858,7 +9858,6 @@ EOD;
if ($evaluationResultInfo) {
$evaluationResult = $evaluationResultInfo['score'] * 100 / $evaluationResultInfo['max_score'];
if ($evaluationResult >= 80) {
$stars++;
}

@ -4140,12 +4140,12 @@ class learnpathItem
public static function humanize_status($status, $decorate = true, $type = 'classic')
{
$statusList = [
'completed' => 'ScormCompstatus',
'incomplete' => 'ScormIncomplete',
'failed' => 'ScormFailed',
'passed' => 'ScormPassed',
'browsed' => 'ScormBrowsed',
'not attempted' => 'ScormNotAttempted',
'completed' => 'Completed',
'incomplete' => 'Incomplete',
'failed' => 'Failed',
'passed' => 'Passed',
'browsed' => 'Browsed',
'not attempted' => 'Not attempted',
];
$myLessonStatus = get_lang($statusList[$status]);

@ -15,29 +15,28 @@ if (!isset($origin)) {
$origin = 'learnpath';
}
$sessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : api_get_session_id();
$courseCode = isset($_GET['course']) ? $_GET['course'] : api_get_course_id();
$userId = isset($_GET['student_id']) ? (int) $_GET['student_id'] : api_get_user_id();
$lpId = isset($_GET['lp_id']) ? $_GET['lp_id'] : null;
$lpItemId = isset($_GET['lp_item_id']) ? $_GET['lp_item_id'] : null;
$extendId = isset($_GET['extend_id']) ? $_GET['extend_id'] : null;
$extendAttemptId = isset($_GET['extend_attempt_id']) ? $_GET['extend_attempt_id'] : null;
$extendedAttempt = isset($_GET['extend_attempt']) ? $_GET['extend_attempt'] : null;
$extendedAll = isset($_GET['extend_all']) ? $_GET['extend_all'] : null;
$lpId = $_GET['lp_id'] ?? null;
$lpItemId = $_GET['lp_item_id'] ?? null;
$extendId = $_GET['extend_id'] ?? null;
$extendAttemptId = $_GET['extend_attempt_id'] ?? null;
$extendedAttempt = $_GET['extend_attempt'] ?? null;
$extendedAll = $_GET['extend_all'] ?? null;
$export = isset($_GET['export']) && 'csv' === $_GET['export'];
$allowExtend = isset($_GET['allow_extend']) ? $_GET['allow_extend'] : 1;
$allowExtend = $_GET['allow_extend'] ?? 1;
$lpReportType = api_get_setting('lp_show_reduced_report');
$type = 'classic';
if ('true' === $lpReportType) {
$type = 'simple';
}
$courseInfo = api_get_course_info($courseCode);
$course = api_get_course_entity();
$session = api_get_session_entity();
return Tracking::getLpStats(
$userId,
$courseInfo,
$sessionId,
$course,
$session,
$origin,
$export,
$lpId,

Loading…
Cancel
Save