From 909a75a651dc064d17c332c61ea5cb7f1bb38e0b Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 7 Aug 2012 12:08:47 +0200 Subject: [PATCH] Disable games in learnpathitem --- main/newscorm/learnpathItem.class.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index 4caa347594..008dc22eb1 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -75,7 +75,7 @@ class learnpathItem { public function __construct($id, $user_id = null, $course_id = null, $item_content = null) { // Get items table. if (!isset($user_id)) { $user_id = api_get_user_id(); } - if (self::debug > 0) { error_log('New LP - In learnpathItem constructor: '.$id.','.$user_id, 0); } + if (self::debug > 0) { error_log("New LP - In learnpathItem constructor: id: $id user_id: $user_id course_id: $course_id item_content: $item_content", 0); } if (empty($course_id)) { $course_id = api_get_course_int_id(); @@ -85,7 +85,7 @@ class learnpathItem { $items_table = Database::get_course_table(TABLE_LP_ITEM); $this->course_id = api_get_course_int_id(); - $id = (int) $id; + $id = intval($id); if (empty($item_content)) { $sql = "SELECT * FROM $items_table WHERE c_id = $course_id AND id = $id"; @@ -122,7 +122,8 @@ class learnpathItem { } $this->save_on_close = true; $this->db_id = $id; - $this->seriousgame_mode = $this->get_seriousgame_mode(); + //$this->seriousgame_mode = $this->get_seriousgame_mode(); + $this->seriousgame_mode = 0; // Get search_did. if (api_get_setting('search_enabled') == 'true') { @@ -138,8 +139,7 @@ class learnpathItem { } } $this->audio = $row['audio']; - - //error_log('New LP - End of learnpathItem constructor for item '.$id, 0); + if (self::debug > 0) error_log('New LP - End of learnpathItem constructor for item '.$id, 0); return true; } @@ -669,7 +669,7 @@ class learnpathItem { * @author ndiechburg **/ public function get_seriousgame_mode() { - if(self::debug>2){error_log('New LP - In learnpathItem::get_seriousgame_mode()',0);} + if(self::debug>2){error_log('New LP - In learnpathItem::get_seriousgame_mode()',0);} $course_id = api_get_course_int_id(); if (!isset($this->seriousgame_mode)) { if (!empty($this->lp_id)) { @@ -2664,6 +2664,4 @@ class learnpathItem { $sql = "UPDATE $tbl_lp_item SET audio = '' WHERE c_id = $course_id AND id IN (".$this->db_id.")"; Database::query($sql); } - - -} +} \ No newline at end of file