Skip to content
Browse files

MDL-50798 question: Raise time limit when rendering questions

Rendering a large number of questions may be quite slow, so we want to
raise the limit.

We don’t call raise() in the loop because the quiz buffer captures this
function for a AJAX script, and we should only call raise if we expect
a corresponding output to the users browser. This helps to prevent
unexpected load balancer disconnects. See core_php_time_limit::raise()
for more details.
  • Loading branch information...
merrill-oakland committed Jul 8, 2015
1 parent 1f2979d commit 92c067f61735805cfb4f22c2ddea1aa9392c8dc6
Showing with 5 additions and 0 deletions.
  1. +5 −0 question/classes/bank/view.php
@@ -664,6 +664,11 @@ protected function display_question_list($contexts, $pageurl, $categoryandcontex
$showquestiontext = false, $addcontexts = array()) {
global $CFG, $DB, $OUTPUT;
// This function can be moderately slow with large question counts and may time out.
// We probably do not want to raise it to unlimited, so randomly picking 5 minutes.
// Note: We do not call this in the loop because quiz ob_ captures this function (see raise() PHP doc).
$category = $this->get_current_category($categoryandcontext);
$strselectall = get_string('selectall');

0 comments on commit 92c067f

Please sign in to comment.
You can’t perform that action at this time.