Browse Source

Minor cosmetic changes

Julio Montoya 13 years ago
parent
commit
68e86e056f

+ 1 - 12
main/exercice/exercise.lib.php

@@ -783,7 +783,6 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
     $TBL_TRACK_ATTEMPT          = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
     $TBL_TRACK_ATTEMPT_RECORDING= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);    
     
-    
     $session_id_and = ' AND te.session_id = ' . api_get_session_id() . ' ';
     
     $exercise_id = intval($_GET['exerciseId']);
@@ -799,17 +798,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
     }  
     
     if ($is_allowedToEdit || $is_tutor) {
-        /*
-        $user_id_and = '';
-        if (!empty ($_REQUEST['filter_by_user'])) {
-            if ($_REQUEST['filter_by_user'] == 'all') {
-                $user_id_and = " AND user_id LIKE '%'";
-            } else {
-                $user_id_and = " AND user_id = '" . intval($_REQUEST['filter_by_user']) . "' ";
-            }
-        }*/
-        
-          
+		
         if ($_GET['gradebook'] == 'view') {
             $exercise_where_query = ' te.exe_exo_id = ce.id AND ';
         }

+ 2 - 2
main/inc/ajax/exercise.ajax.php

@@ -71,14 +71,14 @@ switch ($action) {
                 FROM $user_table u INNER JOIN (
                     SELECT  t.exe_user_id, count(question_id) as count_questions, status,
                     start_date, exe_result, exe_weighting, exe_result/exe_weighting as score, exe_duration, questions_to_check, orig_lp_id
-                    FROM  $track_exercise  t LEFT JOIN   $track_attempt a ON (a.exe_id = t.exe_id AND  t.exe_user_id = a.user_id ) 
+                    FROM  $track_exercise  t LEFT JOIN $track_attempt a ON (a.exe_id = t.exe_id AND  t.exe_user_id = a.user_id ) 
                     WHERE t.status = 'incomplete' AND
                           $where_condition  
                 GROUP BY exe_user_id                    
                 ) as aa
                 ON aa.exe_user_id = user_id                    
                 ORDER BY $sidx $sord LIMIT $start, $limit";
-                //echo $sql;
+        //echo $sql;
         $result = Database::query($sql);
         $results = array();
         

+ 6 - 2
main/inc/lib/chat.lib.php

@@ -19,8 +19,12 @@ class Chat extends Model {
 	function heartbeat() {		
 		$to_user_id = api_get_user_id();
 		$my_user_info  = api_get_user_info();
-		
-		$sql = "SELECT * FROM ".$this->table." WHERE (to_user = '".intval($to_user_id)."' AND recd = 0) ORDER BY id ASC";
+		$minutes = 60;
+		$now = time() - $minutes*60;
+		$now = api_get_utc_datetime($now);
+		//OR  sent > '$now'
+		$sql = "SELECT from_user, recd, sent, message FROM ".$this->table." 
+				WHERE to_user = '".intval($to_user_id)."' AND (recd = 0 ) ORDER BY id ASC";
 		$result = Database::query($sql);
 		
 		$chatBoxes = array();		

+ 5 - 6
main/inc/lib/javascript/chat/js/chat.js

@@ -29,13 +29,12 @@ var chatHeartbeatTime = minChatHeartbeat;
 var originalTitle;
 var blinkOrder = 0;
 
-var chatboxFocus = new Array();
-var newMessages = new Array();
-var newMessagesWin = new Array();
-var chatBoxes = new Array();
+var chatboxFocus	= new Array();
+var newMessages		= new Array();
+var newMessagesWin	= new Array();
+var chatBoxes		= new Array();
 
-
-//var ajax_url = 'chat.php'; // This variable is loaded in header.inc.php
+//var ajax_url = 'chat.php'; // This variable is loaded in header.inc.php/ template/layout/head.tpl
 
 $(document).ready(function(){
 	originalTitle = document.title;

+ 2 - 2
main/inc/lib/sortabletable.class.php

@@ -118,7 +118,7 @@ class SortableTable extends HTML_Table {
 		$this->page_nr = isset ($_GET[$this->param_prefix.'page_nr']) 	  ? intval($_GET[$this->param_prefix.'page_nr']) : $this->page_nr;
 		$this->column  = isset ($_SESSION[$this->param_prefix.'column'])  ? intval($_SESSION[$this->param_prefix.'column']) : $default_column;
 		$this->column  = isset ($_GET[$this->param_prefix.'column']) 	  ? intval($_GET[$this->param_prefix.'column']) : $this->column;
-
+		
 		//$this->direction = isset ($_SESSION[$this->param_prefix.'direction']) ? $_SESSION[$this->param_prefix.'direction'] : $default_order_direction;
 
 
@@ -838,7 +838,7 @@ class SortableTable extends HTML_Table {
 	 * or DESC)
 	 */
 	public function get_table_data ($from = null, $per_page = null, $column = null, $direction = null) {
-		if (!is_null($this->get_data_function)) {
+		if (!is_null($this->get_data_function)) {			
 			return call_user_func($this->get_data_function, $from, $this->per_page, $this->column, $this->direction);
 		}
 		return array ();