From 89d7d96279c700a694b4894ca8518c979492f00f Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 11 Dec 2007 18:49:56 +0000 Subject: [PATCH] MDL-12546 - The choice module was calling get_users_by_capability, which hammers the database and returns lots of data, inside a loop over users - and it was calling it with identical parameters each time. Ouch! Actually, since the fix for MDL-12331, which changed the get_users_by_capability call at the top of this function, the check it was doing is entirely redundant anyway, so I removed it. Merged from MOODLE_19_STABLE. --- mod/choice/lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 84525526ea..24e9f1fa70 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -367,10 +367,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') { $answer = $answers[$user->id]; $useranswer[(int)$answer->optionid][] = $user; } else { - $usershownotans = get_users_by_capability($context, 'mod/choice:choose', 'u.id', 'u.id ASC', '', '', $currentgroup, '', false); - if ($user->id == $usershownotans[$user->id]->id) { - $useranswer[0][] = $user; - } + $useranswer[0][] = $user; } } } -- 2.39.5