Browse Source

Minor cosmetic changes

Julio Montoya 12 years ago
parent
commit
fa0aae33ad

+ 3 - 3
main/newscorm/learnpath.class.php

@@ -1451,7 +1451,7 @@ class learnpath {
         $i = 0;
         foreach ($this->items as $id => $dummy) {
             // Trying failed and browsed considered "progressed" as well.
-            if ($this->items[$id]->status_is(array (
+            if ($this->items[$id]->status_is(array(
                     'completed',
                     'passed',
                     'succeeded',
@@ -1515,12 +1515,12 @@ class learnpath {
         }
         $total = 0;
         foreach ($this->items as $temp2) {
-            if (!in_array($temp2->get_type(), array (
+            if (!in_array($temp2->get_type(), array(
                     'dokeos_chapter',
                     'chapter',
                     'dir'
                 )))
-                $total++;
+            $total++;
         }
         return $total;
     }

+ 2 - 2
main/newscorm/learnpathItem.class.php

@@ -1003,7 +1003,7 @@ class learnpathItem {
 		if ($check_db) {
 			if (self::debug > 2) { error_log('New LP - In learnpathItem::get_status(): checking db', 0); }
 			$table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
-			$sql = "SELECT status FROM $table WHERE c_id = $course_id AND id = '".$this->db_item_view_id."' AND view_count = '".$this->get_attempt_id()."'";
+			$sql = "SELECT status FROM $table WHERE c_id = $course_id AND id = '".$this->db_item_view_id."' AND view_count = '".$this->get_attempt_id()."'";            
 			if (self::debug > 2) { error_log('New LP - In learnpathItem::get_status() - Checking DB: '.$sql, 0); }
 
 			$res = Database::query($sql);
@@ -1012,7 +1012,7 @@ class learnpathItem {
 				if ($update_local) {
 					$this->set_status($row['status']);
 				}
-				if (self::debug > 2) { error_log('New LP - In learnpathItem::get_status() - Returning db value '.$row['status'], 0); }
+				if (self::debug > 2) { error_log('New LP - In learnpathItem::get_status() - Returning db value '.$row['status'], 0); }                
 				return $row['status'];
 			}
 		} else {

+ 20 - 17
main/newscorm/scorm_api.php

@@ -1092,32 +1092,35 @@ function chamilo_void_save_asset(myscore,mymax)
  * @param	integer Priority (0 for top priority, 3 for lowest)
  */
 function logit_scorm(message,priority) {
-    if(scorm_logs == 0) {return false;}
-    if(scorm_logs>priority){ /* fixed see http://support.chamilo.org/issues/370 */
-        if($("#lp_log_name") && $("#log_content")){
+    //scorm_logs = 10000;
+    if (scorm_logs == 0) { return false; }
+    if (scorm_logs > priority) { 
+        /* fixed see http://support.chamilo.org/issues/370 */
+        if ($("#lp_log_name") && $("#log_content")){
             $("#log_content").append("SCORM: " + message + "<br/>");
         }
-    params = {
-        msg: "SCORM: " + message,
-        debug: scorm_logs
-    };
-    $.ajax({
-        type: "POST",
-        data: params,
-        url: "lp_ajax_log.php",
-        dataType: "script",
-        async: true
-    });
-
+        params = {
+            msg: "SCORM: " + message,
+            debug: scorm_logs
+        };
+        $.ajax({
+            type: "POST",
+            data: params,
+            url: "lp_ajax_log.php",
+            dataType: "script",
+            async: true
+        });
+        //console.log(message);
     }
 }
+
 /**
  * Logs information about LMS activity into the log frame
  * @param	string	Message to log
  * @param	integer Priority (0 for top priority, 3 for lowest)
  */
 function logit_lms(message, priority){
-    if (lms_logs>=priority) {
+    if (lms_logs >= priority) {
     if ($("#lp_log_name") && $("#log_content")) {
         $("#log_content").append("LMS: " + message + "<br />");
     }
@@ -1133,7 +1136,7 @@ function logit_lms(message, priority){
         async: true
         });
     }
-    console.log(message);
+    //console.log(message);
 }
 
 /**