Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIXED: Bug with reporting numerical question types.

  • Loading branch information...
commit 66fbb3b10fe97e069d48ff1505c540450d659e74 1 parent 5578e1b
michaelpenne authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 mod/lesson/report.php
View
10 mod/lesson/report.php
@@ -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 {
Please sign in to comment.
Something went wrong with that request. Please try again.