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

This commit is contained in:
danmarsden 2005-04-01 02:37:19 +00:00
parent a4a65bf6f6
commit 1c49ca9a09

View file

@ -85,7 +85,12 @@
if (isteacher($course->id)) {
if ( $allanswers = get_records("choice_answers", "choiceid", $choice->id)) {
$responsecount = count($allanswers);
$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;
}