[svn r12542] fix a bug when displaying result of multiple answers

skala
Eric Marguin 19 years ago
parent 9218e46b90
commit 42ea3df622
  1. 8
      main/exercice/exercise_result.php

@ -27,7 +27,7 @@
* @package dokeos.exercise * @package dokeos.exercise
* @author Olivier Brouckaert, main author * @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring * @author Roan Embrechts, some refactoring
* @version $Id: exercise_result.php 12503 2007-05-30 10:27:42Z elixir_inter $ * @version $Id: exercise_result.php 12542 2007-06-06 08:17:24Z elixir_inter $
* *
* @todo split more code up in functions, move functions to library? * @todo split more code up in functions, move functions to library?
*/ */
@ -211,7 +211,7 @@ function display_unique_or_multiple_answer($answerType, $studentChoice, $answer,
<td width="45%" style="border-bottom: 1px solid #4171B5;"> <td width="45%" style="border-bottom: 1px solid #4171B5;">
<?php <?php
$answerComment=api_parse_tex($answerComment); $answerComment=api_parse_tex($answerComment);
if($studentChoice) echo nl2br(make_clickable($answerComment)); else echo '&nbsp;'; ?> if($studentChoice || $answerType == MULTIPLE_ANSWER) echo nl2br(make_clickable($answerComment)); else echo '&nbsp;'; ?>
</td> </td>
</tr> </tr>
<?php <?php
@ -467,9 +467,7 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
case MULTIPLE_ANSWER : case MULTIPLE_ANSWER :
$studentChoice=$choice[$answerId]; $studentChoice=$choice[$answerId];
if(intval($studentChoice) == intval($answerCorrect)) {
if($studentChoice)
{
$questionScore+=$answerWeighting; $questionScore+=$answerWeighting;
$totalScore+=$answerWeighting; $totalScore+=$answerWeighting;
} }

Loading…
Cancel
Save