Minor cleaning files

skala
Julio Montoya 13 years ago
parent 231430afe6
commit a0d2886cf8
  1. 7
      main/gradebook/gradebook_edit_cat.php
  2. 10
      main/newscorm/learnpath.class.php
  3. 6
      main/newscorm/lp_ajax_last_update_status.php
  4. 6
      main/newscorm/lp_ajax_save_objectives.php
  5. 6
      main/newscorm/lp_ajax_switch_item.php
  6. 6
      main/newscorm/lp_ajax_switch_item_toc.php
  7. 18
      main/newscorm/lp_comm.server.php
  8. 8
      main/newscorm/lp_controller.php

@ -19,13 +19,11 @@ block_students();
$edit_cat = isset($_REQUEST['editcat']) ? $_REQUEST['editcat'] : '';
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
$htmlHeadXtra[] = '<script type="text/javascript">
$(document).ready(function () {
$(document).ready(function() {
$("#skills").fcbkcomplete({
json_url: "'.api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=find_skills",
cache: false,
@ -112,9 +110,6 @@ if ($form->validate()) {
$cat->set_skills($values['skills']);
$cat->set_user_id($values['hid_user_id']);
$cat->set_parent_id($values['hid_parent_id']);
//$cat->update_children_weight($values['weight']);
$cat->set_weight($values['weight']);
if ($values['hid_parent_id'] == 0 ) {

@ -1714,14 +1714,8 @@ class learnpath {
if ($this->debug > 0) {
error_log('New LP - In learnpath::get_navigation_bar()', 0);
}
// TODO: Find a good value for the following variables.
$file = '';
$openDir = '';
$edoceo = '';
$time = 0;
$navbar = '';
$RequestUri = '';
$navbar = null;
$lp_id = $this->lp_id;
$mycurrentitemid = $this->get_current_item_id();
if ($this->mode == 'fullscreen') {
$navbar = '

@ -51,16 +51,16 @@ function last_update_status($lp_id, $user_id, $view_id, $item_id) {
require_once 'scormItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 2) { error_log(print_r($oLP, true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code,$lp_id,$user_id);
} else {
if ($debug > 2) { error_log('////Reusing session lp', 0); }
if ($debug > 2) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}

@ -40,16 +40,16 @@ function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = arr
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP =unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 2) { error_log(print_r($oLP,true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code, $lp_id, $user_id);
}else{
if ($debug > 2) { error_log('////Reusing session lp', 0); }
if ($debug > 2) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}

@ -47,16 +47,16 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 1) { error_log(print_r($oLP,true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code,$lp_id,$user_id);
} else {
if ($debug > 1) { error_log('////Reusing session lp', 0); }
if ($debug > 1) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}

@ -38,16 +38,16 @@ function switch_item_toc($lp_id, $user_id, $view_id, $current_item, $next_item)
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 1) { error_log(print_r($oLP, true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code,$lp_id,$user_id);
} else {
if ($debug > 1) { error_log('////Reusing session lp', 0); }
if ($debug > 1) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}

@ -75,16 +75,16 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 2) { error_log(print_r($oLP, true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code, $lp_id, $user_id);
} else {
if ($debug > 2) { error_log('////Reusing session lp', 0); }
if ($debug > 2) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}
@ -207,16 +207,16 @@ function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = arr
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 2) { error_log(print_r($oLP, true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code,$lp_id,$user_id);
} else {
if ($debug > 2) { error_log('////Reusing session lp', 0); }
if ($debug > 2) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}
@ -261,16 +261,16 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) { error_log('////$_SESSION[lpobject] is set', 0); }
if ($debug > 1) { error_log('$_SESSION[lpobject] is set', 0); }
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 1) { error_log(print_r($oLP, true), 0); }
if ($debug > 2) { error_log('////Building new lp', 0); }
if ($debug > 2) { error_log('Building new lp', 0); }
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code,$lp_id,$user_id);
} else {
if ($debug > 1) { error_log('////Reusing session lp', 0); }
if ($debug > 1) { error_log('Reusing session lp', 0); }
$mylp = & $oLP;
}
}

@ -122,8 +122,8 @@ if (isset($_SESSION['lpobject'])) {
$oLP = unserialize($_SESSION['lpobject']);
if (isset($oLP) && is_object($oLP)) {
if ($debug > 0) error_log('New LP - oLP is object', 0);
if ($myrefresh == 1 OR (empty($oLP->cc)) OR $oLP->cc != api_get_course_id() OR $oLP->lp_view_session_id != $session_id OR $oLP->scorm_debug == '1') {
if ($debug > 0) error_log('New LP - Course has changed, discard lp object', 0);
if ($myrefresh == 1 OR empty($oLP->cc) OR $oLP->cc != api_get_course_id() OR $oLP->lp_view_session_id != $session_id OR $oLP->scorm_debug == '1') {
if ($debug > 0) error_log('New LP - Course has changed, discard lp object', 0);
if ($myrefresh == 1) { $myrefresh_id = $oLP->get_id(); }
$oLP = null;
Session::erase('oLP');
@ -135,6 +135,7 @@ if (isset($_SESSION['lpobject'])) {
}
}
$course_id = api_get_course_int_id();
if ($debug>0) error_log('New LP - Passed data remains check', 0);
@ -820,9 +821,10 @@ switch ($action) {
break;
case 'stats':
if ($debug > 0) error_log('New LP - stats action triggered', 0);
if (!$lp_found) { error_log('New LP - No learnpath given for stats', 0); require 'lp_list.php'; }
else {
else {
$_SESSION['oLP']->save_current();
$_SESSION['oLP']->save_last();
require 'lp_stats.php';

Loading…
Cancel
Save