Minor - format code

pull/3235/head
Julio Montoya 6 years ago
parent 611af1017b
commit 3e29b73d00
  1. 1
      main/exercise/result.php
  2. 2
      main/lp/learnpath.class.php
  3. 8
      main/lp/lp_ajax_save_item.php
  4. 5
      main/lp/lp_content.php
  5. 3
      main/lp/lp_controller.php

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;

@ -3665,7 +3665,7 @@ class learnpath
$type_quiz = false;
foreach ($list as $toc) {
if ($toc['id'] == $lp_item_id && $toc['type'] == 'quiz') {
if ($toc['id'] == $lp_item_id && $toc['type'] === 'quiz') {
$type_quiz = true;
}
}

@ -183,7 +183,7 @@ function save_item(
$my_type = $myLPI->get_type();
// Set status to completed for hotpotatoes if score > 80%.
if ($my_type == 'hotpotatoes') {
if ($my_type === 'hotpotatoes') {
if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) {
if (($score / $max) > 0.8) {
$myStatus = 'completed';
@ -207,7 +207,7 @@ function save_item(
error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false));
}
}
} elseif ($my_type == 'sco') {
} elseif ($my_type === 'sco') {
/*
* This is a specific implementation for SCORM 1.2, matching page 26 of SCORM 1.2's RTE
* "Normally the SCO determines its own status and passes it to the LMS.
@ -254,7 +254,7 @@ function save_item(
* the status to either passed or failed depending on the
* student's score compared to the mastery score.
*/
if ($credit == 'credit' &&
if ($credit === 'credit' &&
$masteryScore &&
(isset($score) && $score != -1) &&
!$statusIsSet && !$statusSignalReceived
@ -471,7 +471,7 @@ function save_item(
error_log("progress: $myComplete / $myTotal");
}
if ($myLPI->get_type() != 'sco') {
if ($myLPI->get_type() !== 'sco') {
// If this object's JS status has not been updated by the SCORM API, update now.
$return .= "olms.lesson_status='".$myStatus."';";
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
@ -6,8 +7,6 @@ use ChamiloSession as Session;
/**
* Script that displays an error message when no content could be loaded.
*
* @package chamilo.learnpath
*
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
require_once __DIR__.'/../inc/global.inc.php';
@ -44,7 +43,7 @@ $list = $learnPath->get_toc();
$dir = false;
foreach ($list as $toc) {
if ($toc['id'] == $lpItemId && $toc['type'] == 'dir') {
if ($toc['id'] == $lpItemId && $toc['type'] === 'dir') {
$dir = true;
}
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
@ -9,8 +10,6 @@ use ChamiloSession as Session;
*
* @todo remove repeated if $lp_found redirect
*
* @package chamilo.learnpath
*
* @author Yannick Warnier <ywarnier@beeznest.org>
*/

Loading…
Cancel
Save