Minor - Replace "OR" with "||", format code, remove comments.

1.10.x
Julio Montoya 11 years ago
parent c0870227e8
commit 725688bd1a
  1. 17
      main/newscorm/learnpath.class.php
  2. 4
      main/newscorm/lp_ajax_initialize.php
  3. 4
      main/newscorm/lp_ajax_save_item.php

@ -1467,7 +1467,7 @@ class learnpath
error_log('New LP - In learnpath::edit_item_prereq(' . $id . ',' . $prerequisite_id . ',' . $mastery_score . ',' . $max_score . ')', 0); error_log('New LP - In learnpath::edit_item_prereq(' . $id . ',' . $prerequisite_id . ',' . $mastery_score . ',' . $max_score . ')', 0);
} }
if (empty ($id) or ($id != strval(intval($id))) or empty ($prerequisite_id)) { if (empty($id) || ($id != strval(intval($id))) || empty ($prerequisite_id)) {
return false; return false;
} }
@ -1562,7 +1562,7 @@ class learnpath
error_log('New LP - In learnpath::get_brother_chapters()', 0); error_log('New LP - In learnpath::get_brother_chapters()', 0);
} }
if (empty ($id) OR $id != strval(intval($id))) { if (empty($id)|| $id != strval(intval($id))) {
return array (); return array ();
} }
@ -1602,7 +1602,7 @@ class learnpath
error_log('New LP - In learnpath::get_brother_items(' . $id . ')', 0); error_log('New LP - In learnpath::get_brother_items(' . $id . ')', 0);
} }
if (empty ($id) OR $id != strval(intval($id))) { if (empty ($id) || $id != strval(intval($id))) {
return array (); return array ();
} }
@ -3768,7 +3768,7 @@ class learnpath
if ($this->debug > 0) { if ($this->debug > 0) {
error_log('New LP - In learnpath::move_item(' . $id . ',' . $direction . ')', 0); error_log('New LP - In learnpath::move_item(' . $id . ',' . $direction . ')', 0);
} }
if (empty ($id) or empty ($direction)) { if (empty($id) || empty($direction)) {
return false; return false;
} }
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
@ -4960,10 +4960,11 @@ class learnpath
if ($this->debug > 0) { if ($this->debug > 0) {
error_log('New LP - In learnpath::start_current_item()', 0); error_log('New LP - In learnpath::start_current_item()', 0);
} }
if ($this->current != 0 AND is_object($this->items[$this->current])) { if ($this->current != 0 && is_object($this->items[$this->current])) {
$type = $this->get_type(); $type = $this->get_type();
$item_type = $this->items[$this->current]->get_type(); $item_type = $this->items[$this->current]->get_type();
if (($type == 2 && $item_type != 'sco') OR ($type == 3 && $item_type != 'au') OR if (($type == 2 && $item_type != 'sco') ||
($type == 3 && $item_type != 'au') ||
($type == 1 && $item_type != TOOL_QUIZ && $item_type != TOOL_HOTPOTATOES) ($type == 1 && $item_type != TOOL_QUIZ && $item_type != TOOL_HOTPOTATOES)
) { ) {
$this->items[$this->current]->open($allow_new_attempt); $this->items[$this->current]->open($allow_new_attempt);
@ -5595,7 +5596,7 @@ class learnpath
$audio = ''; $audio = '';
if (!$update_audio OR $update_audio <> 'true') { if (!$update_audio || $update_audio <> 'true') {
if (!empty($arrLP[$i]['audio'])) { if (!empty($arrLP[$i]['audio'])) {
/*$audio .= '<span id="container'.$i.'"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>'; /*$audio .= '<span id="container'.$i.'"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>';
$audio .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>'; $audio .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>';
@ -5628,7 +5629,7 @@ class learnpath
$prerequisities_icon = ''; $prerequisities_icon = '';
if ($is_allowed_to_edit) { if ($is_allowed_to_edit) {
if (!$update_audio OR $update_audio <> 'true') { if (!$update_audio || $update_audio <> 'true') {
$move_icon .= '<a class="moved" href="#">'; $move_icon .= '<a class="moved" href="#">';
$move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); $move_icon .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
$move_icon .= '</a>'; $move_icon .= '</a>';

@ -2,8 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script contains the server part of the xajax interaction process. The client part is located * This script contains the server part of the xajax interaction process.
* in lp_api.php or other api's.
* This script, in particular, enables the process of SCO's initialization. It * This script, in particular, enables the process of SCO's initialization. It
* resets the JavaScript values for each SCO to the current LMS status. * resets the JavaScript values for each SCO to the current LMS status.
* @package chamilo.learnpath * @package chamilo.learnpath
@ -11,7 +10,6 @@
*/ */
// Flag to allow for anonymous user - needs to be set before global.inc.php // Flag to allow for anonymous user - needs to be set before global.inc.php
use \ChamiloSession as Session;
$use_anonymous = true; $use_anonymous = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';

@ -358,10 +358,8 @@ function save_item(
} }
$myLPI->set_time($time, 'scorm'); $myLPI->set_time($time, 'scorm');
} }
//if ($debug > 1) { error_log('Done calling set_time - now '.$myLPI->get_total_time(), 0); }
} else {
//$time = $myLPI->get_total_time();
} }
if (isset($suspend) && $suspend != '' && $suspend != 'undefined') { if (isset($suspend) && $suspend != '' && $suspend != 'undefined') {
$myLPI->current_data = $suspend; $myLPI->current_data = $suspend;
} }

Loading…
Cancel
Save