Minor - add error_logs

pull/2467/head
jmontoyaa 8 years ago
parent cc3f6722d5
commit 94c6cba799
  1. 14
      main/lp/learnpath.class.php
  2. 5
      main/lp/learnpathItem.class.php
  3. 3
      main/lp/lp_ajax_save_item.php
  4. 12
      main/lp/lp_ajax_switch_item.php
  5. 7
      main/lp/lp_controller.php
  6. 3
      main/lp/lp_nav.php
  7. 1
      main/lp/lp_view.php

@ -132,7 +132,7 @@ class learnpath
$sql = "SELECT * FROM $lp_table
WHERE iid = $lp_id";
if ($debug) {
error_log('New LP - learnpath::__construct() '.__LINE__.' - Querying lp: '.$sql, 0);
error_log('learnpath::__construct() '.__LINE__.' - Querying lp: '.$sql, 0);
}
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
@ -5579,7 +5579,7 @@ class learnpath
error_log($this->lp_view_session_id);
error_log('api session id');
error_log(api_get_session_id());
error_log('New LP - End of learnpath::start_current_item()');
error_log('End of learnpath::start_current_item()');
}
return true;
@ -11880,19 +11880,25 @@ EOD;
$learnPath = null;
$lpObject = Session::read('lpobject');
if ($lpObject !== null) {
$learnPath = unserialize($lpObject);
if ($debug) {
error_log('getLpFromSession: unserialize');
error_log('------getLpFromSession------');
error_log('------unserialize------');
error_log("lp_view_session_id: ".$learnPath->lp_view_session_id);
error_log("api_get_sessionid: ".api_get_session_id());
}
$learnPath = unserialize($lpObject);
}
if (!is_object($learnPath)) {
$learnPath = new learnpath($courseCode, $lpId, $user_id);
if ($debug) {
error_log('------getLpFromSession------');
error_log('getLpFromSession: create new learnpath');
error_log("create new LP with $courseCode - $lpId - $user_id");
error_log("lp_view_session_id: ".$learnPath->lp_view_session_id);
error_log("api_get_sessionid: ".api_get_session_id());
}
$learnPath = new learnpath($courseCode, $lpId, $user_id);
}
return $learnPath;

@ -3604,6 +3604,7 @@ class learnpathItem
}
if ($debug) {
error_log("accumulate_scorm_time: $accumulateScormTime");
error_log("total_time modified: $total_time");
}
@ -3800,7 +3801,7 @@ class learnpathItem
);
error_log(
'learnpathItem::write_to_db() - credit('.$credit.') or'.
' lesson_mode('.$mode.') prevent recording!',
' lesson_mode('.$mode.') prevent recording!',
0
);
}
@ -4117,7 +4118,7 @@ class learnpathItem
if ($debug) {
error_log(
'learnpathItem::write_to_db() - Got item_view_id '.
$lp_iv_id.', now checking interactions ',
$lp_iv_id.', now checking interactions ',
0
);
}

@ -60,11 +60,11 @@ function save_item(
$userNavigatesAway = 0,
$statusSignalReceived = 0
) {
//global $debug;
$debug = 0;
$return = null;
if ($debug > 0) {
error_log('--------------------------------------');
error_log('lp_ajax_save_item.php : save_item() params: ');
error_log("item_id: $item_id");
error_log("lp_id: $lp_id - user_id: - $user_id - view_id: $view_id - item_id: $item_id");
@ -480,6 +480,7 @@ function save_item(
Session::write('lpobject', serialize($myLP));
Session::write('oLP', $myLP);
if ($debug > 0) {
error_log("lp_view_session_id :".$myLP->lp_view_session_id);
error_log('---------------- lp_ajax_save_item.php : save_item end ----- ');
}

@ -52,7 +52,7 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
$mylp->next();
$new_item_id = $mylp->get_current_item_id();
if ($debug > 1) {
error_log('In {next} - next item is '.$new_item_id.'(current: '.$current_item.')', 0);
error_log('In {next} - next item is '.$new_item_id.'(current: '.$current_item.')');
}
break;
case 'previous':
@ -60,7 +60,7 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
$mylp->previous();
$new_item_id = $mylp->get_current_item_id();
if ($debug > 1) {
error_log('In {previous} - next item is '.$new_item_id.'(current: '.$current_item.')', 0);
error_log('In {previous} - next item is '.$new_item_id.'(current: '.$current_item.')');
}
break;
case 'first':
@ -68,7 +68,7 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
$mylp->first();
$new_item_id = $mylp->get_current_item_id();
if ($debug > 1) {
error_log('In {first} - next item is '.$new_item_id.'(current: '.$current_item.')', 0);
error_log('In {first} - next item is '.$new_item_id.'(current: '.$current_item.')');
}
break;
case 'last':
@ -82,7 +82,7 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
$new_item_id = $next_item;
$mylp->set_current_item($new_item_id);
if ($debug > 1) {
error_log('In {default} - next item is '.$new_item_id.'(current: '.$current_item.')', 0);
error_log('In {default} - next item is '.$new_item_id.'(current: '.$current_item.')');
}
break;
}
@ -123,7 +123,9 @@ function switch_item_details($lp_id, $user_id, $view_id, $current_item, $next_it
$mylaunch_data = $mylpi->get_launch_data();
/*
if ($mylpi->get_type() == 'asset') {
// Temporary measure to save completion of an asset. Later on, Chamilo should trigger something on unload, maybe... (even though that would mean the last item cannot be completed)
// Temporary measure to save completion of an asset. Later on,
// Chamilo should trigger something on unload, maybe...
// (even though that would mean the last item cannot be completed)
$mylesson_status = 'completed';
$mylpi->set_status('completed');
$mylpi->save();

@ -253,13 +253,12 @@ if (!empty($lpObject)) {
}
}
}
if ($debug) {
error_log('$lp_found: '.$lp_found);
}
$course_id = api_get_course_int_id();
if ($debug > 0) {
error_log(' Passed data remains check');
}
if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $_REQUEST['lp_id'])) {
if ($debug > 0) {
error_log(' oLP is not object, has changed or refresh been asked, getting new');

@ -18,7 +18,7 @@ $htmlHeadXtra[] = '<script>
var chamilo_xajax_handler = window.parent.oxajax;
</script>';
$lpItemId = isset($_REQUEST['lp_item']) ? intval($_REQUEST['lp_item']) : 0;
$lpItemId = isset($_REQUEST['lp_item']) ? (int) $_REQUEST['lp_item'] : 0;
$lpId = isset($_REQUEST['lp_id']) ? (int) $_REQUEST['lp_id'] : 0;
if (!$lpItemId) {
@ -47,7 +47,6 @@ if ($myLP) {
} else {
$lp_theme_css = $my_style;
}
$progress_bar = $myLP->getProgressBar();
$navigation_bar = $myLP->get_navigation_bar();
$mediaplayer = $myLP->get_mediaplayer($lpItemId, $autostart);

@ -437,6 +437,7 @@ if ($is_allowed_to_edit) {
]);
}
$buttonHomeText = get_lang('CourseHomepageLink');
$returnLink = api_get_course_setting('lp_return_link');
switch ($returnLink) {
case 1: // lp list

Loading…
Cancel
Save