Browse Source

fixing propagate neg = 0, we set to 0 negative values

Julio Montoya 14 years ago
parent
commit
019c46cce3

+ 1 - 2
main/exercice/exercise.class.php

@@ -2365,8 +2365,7 @@ class Exercise {
                         if ($questionScore==-1) {
                             echo get_lang('Score').": 0 /".float_format($questionWeighting);
                         } else {
-
-                            if ($propagate_neg && $questionScore < 0) {
+                            if ($propagate_neg == 0 && $questionScore < 0) {
                     	        $questionScore = 0;
                     	    }                    	    
                             echo get_lang('Score').": ".float_format($questionScore,1)."/".float_format($questionWeighting,1);

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

@@ -1051,7 +1051,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction) {
 
                 $my_res     = float_format($results[$i]['exresult'],1);
                 $my_total   = float_format($results[$i]['exweight'],1);
-                if ($results[$i]['propagate_neg'] && $my_res < 0) {
+                if (!$results[$i]['propagate_neg'] && $my_res < 0) {
                     $my_res = 0;
                 }
                 $ex = show_score($my_res, $my_total);

+ 2 - 2
main/exercice/exercise_result.php

@@ -314,8 +314,8 @@ if($origin != 'learnpath') {
     echo get_lang('YourTotalScore')." ";
 	if ($dsp_percent) {
         echo number_format(($totalScore/$totalWeighting)*100,1,'.','')."%";
-	} else {
-	    if ($objExercise->selectPropagateNeg() && $totalScore < 0) {
+	} else {	    
+	    if ($objExercise->selectPropagateNeg() == 0 && $totalScore < 0) {
 		    $totalScore = 0;
         } 
         echo show_score($totalScore, $totalWeighting, false);

+ 2 - 2
main/exercice/exercise_show.php

@@ -589,7 +589,7 @@ if ($show_results) {
 		$my_total_weight = $questionWeighting;       
 
 		echo '<div id="question_score">';
-	    if ($objExercise->selectPropagateNeg() && $my_total_score < 0) {
+	    if ($objExercise->selectPropagateNeg() == 0 && $my_total_score < 0) {
 	        $my_total_score = 0;
 	    }  
 	    
@@ -613,7 +613,7 @@ if ($origin!='learnpath' || ($origin == 'learnpath' && isset($_GET['fb_type'])))
 			$my_result = float_format($my_result,1);
 			echo $my_result."%";
 		} else {          
-		    if ($objExercise->selectPropagateNeg() && $totalScore < 0) {
+		    if ($objExercise->selectPropagateNeg() == 0 && $totalScore < 0) {
 		        $totalScore = 0;
 		    }          
             echo show_score($totalScore, $totalWeighting, false);