Permalink
Browse files

FIXED: Bug with reporting numerical question types.

  • Loading branch information...
1 parent 5578e1b commit 66fbb3b10fe97e069d48ff1505c540450d659e74 michaelpenne committed Aug 29, 2005
Showing with 5 additions and 5 deletions.
  1. +5 −5 mod/lesson/report.php
View
@@ -583,11 +583,11 @@
$answerdata->answers[] = array(get_string("nooneansweredthisquestion", "lesson"), " ");
}
$i++;
- } else if ($answer->answer == $useranswer->useranswer && $useranswer != NULL) {
+ } else if ($answer->id == $useranswer->answerid && $useranswer != NULL) {
// get in here when a user answer matches one of the answers to the page
$data = "<input type=\"text\" size=\"50\" disabled=\"disabled\" readonly=\"readonly\" value=\"$useranswer->useranswer\">";
- if (isset($pagestats[$page->id][$answer->answer])) {
- $percent = $pagestats[$page->id][$answer->answer] / $pagestats[$page->id]["total"] * 100;
+ if (isset($pagestats[$page->id][$useranswer->useranswer])) {
+ $percent = $pagestats[$page->id][$useranswer->useranswer] / $pagestats[$page->id]["total"] * 100;
$percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson");
} else {
@@ -614,8 +614,8 @@
} elseif ($answer == end($answers) && empty($answerdata) && $useranswer != NULL) {
// get in here when what the user entered is not one of the answers
$data = "<input type=\"text\" size=\"50\" disabled=\"disabled\" readonly=\"readonly\" value=\"$useranswer->useranswer\">";
- if (isset($pagestats[$page->id][$answer->answer])) {
- $percent = $pagestats[$page->id][$answer->answer] / $pagestats[$page->id]["total"] * 100;
+ if (isset($pagestats[$page->id][$useranswer->useranswer])) {
+ $percent = $pagestats[$page->id][$useranswer->useranswer] / $pagestats[$page->id]["total"] * 100;
$percent = round($percent, 2);
$percent .= "% ".get_string("enteredthis", "lesson");
} else {

0 comments on commit 66fbb3b

Please sign in to comment.