Browse Source

Fixing how is shows multichoice question on show answers.

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
f552665ebf
  1. 1
      CHANGES.md
  2. 14
      showanswers.php

1
CHANGES.md

@ -3,6 +3,7 @@ Changes in version 3.36.31.1 (2015123101)
- Fix at backup. - Fix at backup.
- Fix not to show how many correct letters are when printing the crossword. - Fix not to show how many correct letters are when printing the crossword.
- Moodle 3.1 compatibility. - Moodle 3.1 compatibility.
- Fixing how is shows multichoice question on show answers.
Changes in version 3.36.30.1 (2015123001) Changes in version 3.36.30.1 (2015123001)
------------------------------------------------------------------ ------------------------------------------------------------------

14
showanswers.php

@ -206,7 +206,7 @@ function game_showanswers_quiz( $game, $context) {
$table = '{question} q,{quiz_question_instances} qqi'; $table = '{question} q,{quiz_question_instances} qqi';
} else { } else {
$select = "qs.quizid='$game->quizid' ". $select = "qs.quizid='$game->quizid' ".
" AND qs.questionid=q.id"; " AND qs.questionid=q.id ".game_showanswers_appendselect( $game);
$table = "{question} q,{quiz_slots} qs"; $table = "{question} q,{quiz_slots} qs";
} }
@ -313,21 +313,17 @@ function game_showanswers_question_select( $game, $table, $select, $fields, $ord
foreach ($recs as $rec) { foreach ($recs as $rec) {
if ($i++ > 0) { if ($i++ > 0) {
echo '<br>'; echo '<br>';
}
if ($rec->fraction == 1) { if ($rec->fraction == 1) {
echo " <b>$rec->answer</b>"; echo " <b>$rec->answer</b>";
if ($rec->feedback == '') {
$feedback .= '<br>';
}
} else {
$feedback .= "<b>$rec->feedback</b><br>";
}
} else { } else {
echo " $rec->answer"; echo " $rec->answer";
}
if ($rec->feedback == '') { if ($rec->feedback == '') {
$feedback .= '<br>'; $feedback .= '<br>';
} else { } else {
$feedback .= "<br>"; $feedback .= "<b>{$rec->feedback}</b><br>";
}
} }
} }
echo '</td>'; echo '</td>';

Loading…
Cancel
Save