mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Fix for Bug #2452 - Choice shows a bad number of answers
This commit is contained in:
parent
a4a65bf6f6
commit
1c49ca9a09
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue