Permalink
Browse files

Fix for Bug #2452 - Choice shows a bad number of answers

  • Loading branch information...
1 parent b0debb8 commit 7345d816fe6c51e71dc6ef07e0bbbd3519652932 danmarsden committed Apr 3, 2005
Showing with 7 additions and 2 deletions.
  1. +7 −2 mod/choice/view.php
View
@@ -75,8 +75,13 @@
}
if (isteacher($course->id)) {
- if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
- $responsecount = count($allanswers);
+ if ( $allanswers = get_records("choice_answers", "choice", $choice->id)) {
+ $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 {
$responsecount = 0;
}

0 comments on commit 7345d81

Please sign in to comment.