[svn r19670] Minor - Added error_logging

skala
Cristian Fasanando 17 years ago
parent 87dd6b5bd5
commit 199d5c7103
  1. 23
      main/newscorm/learnpath.class.php

@ -81,7 +81,7 @@ class learnpath {
var $arrMenu = array(); //array for the menu items var $arrMenu = array(); //array for the menu items
var $debug = 0; //logging level var $debug = 1; //logging level
@ -597,7 +597,7 @@ class learnpath {
*/ */
function add_lp($course,$name,$description='',$learnpath='guess',$origin='zip',$zipname='') function add_lp($course,$name,$description='',$learnpath='guess',$origin='zip',$zipname='')
{ {
//if($this->debug>0){error_log('New LP - In learnpath::add_lp()',0);} if($this->debug>0){error_log('New LP - In learnpath::add_lp()',0);}
//TODO //TODO
$tbl_lp = Database::get_course_table('lp'); $tbl_lp = Database::get_course_table('lp');
//check course code exists //check course code exists
@ -1949,6 +1949,7 @@ class learnpath {
*/ */
function get_previous_item_id() function get_previous_item_id()
{ {
if($this->debug>0){error_log('New LP - In learnpath::get_previous_item_id()',0);}
$new_index = $this->get_previous_index(); $new_index = $this->get_previous_index();
return $this->ordered_items[$new_index]; return $this->ordered_items[$new_index];
} }
@ -1977,7 +1978,7 @@ class learnpath {
*/ */
function get_db_progress($lp_id,$user_id,$mode='%', $course_db='', $sincere=false) function get_db_progress($lp_id,$user_id,$mode='%', $course_db='', $sincere=false)
{ {
//if($this->debug>0){error_log('New LP - In learnpath::get_db_progress()',0);} if($this->debug>0){error_log('New LP - In learnpath::get_db_progress()',0);}
$table = Database::get_course_table('lp_view', $course_db); $table = Database::get_course_table('lp_view', $course_db);
$sql = "SELECT * FROM $table WHERE lp_id = $lp_id AND user_id = $user_id"; $sql = "SELECT * FROM $table WHERE lp_id = $lp_id AND user_id = $user_id";
$res = api_sql_query($sql,__FILE__,__LINE__); $res = api_sql_query($sql,__FILE__,__LINE__);
@ -2045,6 +2046,7 @@ class learnpath {
function get_mediaplayer() function get_mediaplayer()
{ {
if($this->debug>0){error_log('New LP - In learnpath::get_mediaplayer()',0);}
global $_course; global $_course;
// Database table definition // Database table definition
@ -2083,6 +2085,7 @@ class learnpath {
*/ */
function get_progress_bar($mode='',$percentage=-1,$text_add='',$from_lp=false) function get_progress_bar($mode='',$percentage=-1,$text_add='',$from_lp=false)
{ {
if($this->debug>0){error_log('New LP - In learnpath::get_progress_bar()',0);}
global $lp_theme_css; global $lp_theme_css;
// Setting up the CSS path of the current style if exists // Setting up the CSS path of the current style if exists
@ -2389,6 +2392,7 @@ class learnpath {
* @return integer Number of interactions * @return integer Number of interactions
*/ */
function get_interactions_count_from_db($lp_iv_id=0){ function get_interactions_count_from_db($lp_iv_id=0){
if($this->debug>1){error_log('New LP - In learnpath::get_interactions_count_from_db()',0);}
if(empty($lp_iv_id)){return -1;} if(empty($lp_iv_id)){return -1;}
$table = Database::get_course_table('lp_iv_interaction'); $table = Database::get_course_table('lp_iv_interaction');
$sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id"; $sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id";
@ -2405,6 +2409,7 @@ class learnpath {
* @todo Translate labels * @todo Translate labels
*/ */
function get_iv_interactions_array($lp_iv_id=0){ function get_iv_interactions_array($lp_iv_id=0){
if($this->debug>0){error_log('New LP - In learnpath::get_iv_interactions_array()',0);}
$list = array(); $list = array();
$table = Database::get_course_table('lp_iv_interaction'); $table = Database::get_course_table('lp_iv_interaction');
$sql = "SELECT * FROM $table WHERE lp_iv_id = $lp_iv_id ORDER BY order_id ASC"; $sql = "SELECT * FROM $table WHERE lp_iv_id = $lp_iv_id ORDER BY order_id ASC";
@ -2443,6 +2448,7 @@ class learnpath {
* @return integer Number of objectives * @return integer Number of objectives
*/ */
function get_objectives_count_from_db($lp_iv_id=0){ function get_objectives_count_from_db($lp_iv_id=0){
if($this->debug>1){error_log('New LP - In learnpath::get_objectives_count_from_db()',0);}
if(empty($lp_iv_id)){return -1;} if(empty($lp_iv_id)){return -1;}
$table = Database::get_course_table('lp_iv_objective'); $table = Database::get_course_table('lp_iv_objective');
$sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id"; $sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id";
@ -2459,6 +2465,7 @@ class learnpath {
* @todo Translate labels * @todo Translate labels
*/ */
function get_iv_objectives_array($lp_iv_id=0){ function get_iv_objectives_array($lp_iv_id=0){
if($this->debug>1){error_log('New LP - In learnpath::get_iv_objectives_array()',0);}
$list = array(); $list = array();
$table = Database::get_course_table('lp_iv_objective'); $table = Database::get_course_table('lp_iv_objective');
$sql = "SELECT * FROM $table WHERE lp_iv_id = $lp_iv_id ORDER BY order_id ASC"; $sql = "SELECT * FROM $table WHERE lp_iv_id = $lp_iv_id ORDER BY order_id ASC";
@ -2559,7 +2566,7 @@ class learnpath {
*/ */
function get_flat_ordered_items_list($lp,$parent=0) function get_flat_ordered_items_list($lp,$parent=0)
{ {
//if($this->debug>0){error_log('New LP - In learnpath::get_flat_ordered_items_list('.$lp.','.$parent.')',0);} if($this->debug>1){error_log('New LP - In learnpath::get_flat_ordered_items_list('.$lp.','.$parent.')',0);}
$list = array(); $list = array();
if(empty($lp)){return false;} if(empty($lp)){return false;}
$tbl_lp_item = Database::get_course_table('lp_item'); $tbl_lp_item = Database::get_course_table('lp_item');
@ -3084,6 +3091,7 @@ class learnpath {
* @return bool True or false * @return bool True or false
*/ */
function has_audio() { function has_audio() {
if($this->debug>1){error_log('New LP - In learnpath::has_audio()',0);}
$has = false; $has = false;
foreach ($this->items as $i=>$item) { foreach ($this->items as $i=>$item) {
if (!empty($this->items[$i]->audio)) { if (!empty($this->items[$i]->audio)) {
@ -4238,6 +4246,7 @@ class learnpath {
*/ */
function tree_array($array) function tree_array($array)
{ {
if($this->debug>1){error_log('New LP - In learnpath::tree_array()',0);}
$array = $this->sort_tree_array($array); $array = $this->sort_tree_array($array);
$this->create_tree_array($array); $this->create_tree_array($array);
} }
@ -4254,6 +4263,7 @@ class learnpath {
*/ */
function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array()) function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array())
{ {
if($this->debug>1){error_log('New LP - In learnpath::create_tree_array())',0);}
if(is_array($array)) if(is_array($array))
{ {
for($i = 0; $i < count($array); $i++) for($i = 0; $i < count($array); $i++)
@ -4300,6 +4310,7 @@ class learnpath {
*/ */
function sort_tree_array($array) function sort_tree_array($array)
{ {
if($this->debug>1){error_log('New LP - In learnpath::sort_tree_array()',0);}
foreach($array as $key => $row) foreach($array as $key => $row)
{ {
$parent[$key] = $row['parent_item_id']; $parent[$key] = $row['parent_item_id'];
@ -4326,6 +4337,7 @@ class learnpath {
*/ */
function overview() function overview()
{ {
if($this->debug>0){error_log('New LP - In learnpath::overview()',0);}
global $charset, $_course; global $charset, $_course;
$return = ''; $return = '';
@ -4805,6 +4817,7 @@ class learnpath {
*/ */
function display_item($item_id, $iframe = true, $msg = '') function display_item($item_id, $iframe = true, $msg = '')
{ {
if($this->debug>0){error_log('New LP - In learnpath::display_item('.$item_id.')',0);}
global $_course; //will disappear global $_course; //will disappear
$return = ''; $return = '';
@ -8951,5 +8964,3 @@ if (!function_exists('trim_value')) {
$value = trim($value); $value = trim($value);
} }
} }
?>

Loading…
Cancel
Save