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

skala
Julio Montoya 15 years ago
parent 8973411b80
commit 019c46cce3
  1. 3
      main/exercice/exercise.class.php
  2. 2
      main/exercice/exercise.lib.php
  3. 4
      main/exercice/exercise_result.php
  4. 4
      main/exercice/exercise_show.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);

@ -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);

@ -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);

@ -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);

Loading…
Cancel
Save