mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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
|
@ -85,7 +85,12 @@
|
||||||
|
|
||||||
if (isteacher($course->id)) {
|
if (isteacher($course->id)) {
|
||||||
if ( $allanswers = get_records("choice_answers", "choiceid", $choice->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 {
|
} else {
|
||||||
$responsecount = 0;
|
$responsecount = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue