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. 10
      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);
}
if (empty ($id) or ($id != strval(intval($id))) or empty ($prerequisite_id)) {
if (empty($id) || ($id != strval(intval($id))) || empty ($prerequisite_id)) {
return false;
}
@ -1562,7 +1562,7 @@ class learnpath
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 ();
}
@ -1602,7 +1602,7 @@ class learnpath
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 ();
}
@ -3768,7 +3768,7 @@ class learnpath
if ($this->debug > 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;
}
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
@ -4960,10 +4960,11 @@ class learnpath
if ($this->debug > 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();
$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)
) {
$this->items[$this->current]->open($allow_new_attempt);
@ -5595,7 +5596,7 @@ class learnpath
$audio = '';
if (!$update_audio OR $update_audio <> 'true') {
if (!$update_audio || $update_audio <> 'true') {
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 .= '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>';
@ -5628,7 +5629,7 @@ class learnpath
$prerequisities_icon = '';
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 .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY);
$move_icon .= '</a>';

@ -2,8 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This script contains the server part of the xajax interaction process.
* This script, in particular, enables the process of SCO's initialization. It
* resets the JavaScript values for each SCO to the current LMS status.
* @package chamilo.learnpath
@ -11,7 +10,6 @@
*/
// Flag to allow for anonymous user - needs to be set before global.inc.php
use \ChamiloSession as Session;
$use_anonymous = true;
require_once '../inc/global.inc.php';
@ -92,9 +90,9 @@ function initialize_item($lp_id, $user_id, $view_id, $next_item) {
if (!empty($mylp_iv_id)) {
$sql = "SELECT objective_id, status, score_raw, score_max, score_min
FROM $mycoursedb
WHERE lp_iv_id = $mylp_iv_id AND c_id = $course_id
ORDER BY id ASC;";
FROM $mycoursedb
WHERE lp_iv_id = $mylp_iv_id AND c_id = $course_id
ORDER BY id ASC;";
$res = Database::query($sql);
while ($row = Database::fetch_row($res)) {
$phpobjectives[] = $row;

@ -358,10 +358,8 @@ function save_item(
}
$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') {
$myLPI->current_data = $suspend;
}

Loading…
Cancel
Save