Browse Source

Replacing intval to floatval because the field in the database (lp_item_view table) is float

Julio Montoya 13 years ago
parent
commit
92c7d3bdf2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      main/exercice/exercice.php

+ 2 - 2
main/exercice/exercice.php

@@ -205,7 +205,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit
 		$tot += $row['marks'];
 	}
 	
-	$totquery = "UPDATE $TBL_TRACK_EXERCICES SET exe_result = '".floatval($tot)."' WHERE exe_id=".$id;
+	$totquery = "UPDATE $TBL_TRACK_EXERCICES SET exe_result = '".floatval($tot)."' WHERE exe_id = ".$id;
     Database::query($totquery);
     
     //@todo move this somewhere else
@@ -263,7 +263,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit
     
     //Updating LP score here    
 	if (in_array($origin, array ('tracking_course','user_course','correct_exercise_in_lp'))) {   
-        $sql_update_score = "UPDATE $TBL_LP_ITEM_VIEW SET score = '" . intval($tot) . "' WHERE id = " .$lp_item_view_id;
+        $sql_update_score = "UPDATE $TBL_LP_ITEM_VIEW SET score = '" . floatval($tot) . "' WHERE id = " .$lp_item_view_id;
         Database::query($sql_update_score);
 		if ($origin == 'tracking_course') {
 			//Redirect to the course detail in lp