Skip to content

Commit

Permalink
Fix for Bug #2452 - Choice shows a bad number of answers
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Apr 3, 2005
1 parent b0debb8 commit 7345d81
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mod/choice/view.php
Expand Up @@ -75,8 +75,13 @@
} }


if (isteacher($course->id)) { if (isteacher($course->id)) {
if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) { if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
$responsecount = count($allanswers); $responsecount = 0;
foreach ($allanswers as $aa) {
if (isstudent($course->id, $aa->userid) or isteacher($course->id, $aa->userid)) { //check to make sure user is enrolled in course.
$responsecount++;
}
}
} else { } else {
$responsecount = 0; $responsecount = 0;
} }
Expand Down

0 comments on commit 7345d81

Please sign in to comment.