Permalink
Browse files

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

  • Loading branch information...
1 parent a4a65bf commit 1c49ca9a0940cc8a3159b88db54334f5b8b9a61f danmarsden committed Apr 1, 2005
Showing with 7 additions and 2 deletions.
  1. +7 −2 mod/choice/view.php
View
9 mod/choice/view.php
@@ -84,8 +84,13 @@
}
if (isteacher($course->id)) {
- if ( $allanswers = get_records("choice_answers", "choiceid", $choice->id)) {
- $responsecount = count($allanswers);
+ if ( $allanswers = get_records("choice_answers", "choiceid", $choice->id)) {
+ $responsecount = 0;
+ foreach ($allanswers as $aa) {
+ if (isstudent($course->id, $aa->userid) or isteacher($course->id, $aa->userid, false)) { //check to make sure user is enrolled in course.
+ $responsecount++;
+ }
+ }
} else {
$responsecount = 0;
}

0 comments on commit 1c49ca9

Please sign in to comment.