[svn r12561] Fix a bug with negative answers

skala
Julian Prud'homme 19 years ago
parent ea04165739
commit 2af9d51ce5
  1. 8
      main/exercice/multiple_answer.class.php

@ -176,7 +176,13 @@ class MultipleAnswer extends Question {
$weighting = trim($form -> getSubmitValue('weighting['.$i.']'));
$goodAnswer = trim($form -> getSubmitValue('correct['.$i.']'));
$weighting = abs($weighting);
if($goodAnswer){
$weighting = abs($weighting);
}
else{
$weighting = abs($weighting);
$weighting = -$weighting;
}
if($weighting > 0)
{
$questionWeighting += $weighting;

Loading…
Cancel
Save