From 019c46cce36d94286eaddeb2148a5949ea1780a7 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 7 Feb 2011 12:15:20 +0100 Subject: [PATCH] fixing propagate neg = 0, we set to 0 negative values --- main/exercice/exercise.class.php | 3 +-- main/exercice/exercise.lib.php | 2 +- main/exercice/exercise_result.php | 4 ++-- main/exercice/exercise_show.php | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/main/exercice/exercise.class.php b/main/exercice/exercise.class.php index 60d4ecb627..9c8160b4c0 100755 --- a/main/exercice/exercise.class.php +++ b/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); diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 7b0b1fd664..ca2d87647d 100755 --- a/main/exercice/exercise.lib.php +++ b/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); diff --git a/main/exercice/exercise_result.php b/main/exercice/exercise_result.php index d952f521da..e2888056bb 100755 --- a/main/exercice/exercise_result.php +++ b/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); diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php index b2c498e80f..df67efb3ba 100755 --- a/main/exercice/exercise_show.php +++ b/main/exercice/exercise_show.php @@ -589,7 +589,7 @@ if ($show_results) { $my_total_weight = $questionWeighting; echo '
'; - 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);