From 8fbc1919dfbd604aa1e001f601a8ab252212e562 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 12 Jun 2014 17:56:17 +0100 Subject: [PATCH] MDL-45970 quiz editing: fix display of random questions. The pass by reference meant the function was clobbering the variable in the calling function. Once that was change, it was not strictly necessary to rename the variable in the function, but I did anyway for clarity. Thanks to Rajesh Taneja for finding the problem, and identifying which bit of code was broken. I really just made the patch. --- mod/quiz/editlib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index 9f3bade1dd6..47a10867c11 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -824,7 +824,7 @@ function quiz_print_singlequestion($question, $returnurl, $quiz) { * @param object $quiz The quiz in the context of which the question is being displayed * @param bool $quiz_qbanktool Indicate to this function if the question bank window open */ -function quiz_print_randomquestion(&$question, &$pageurl, &$quiz, $quiz_qbanktool) { +function quiz_print_randomquestion($question, $pageurl, $quiz, $quiz_qbanktool) { global $DB, $OUTPUT; echo '
'; @@ -882,8 +882,8 @@ function quiz_print_randomquestion(&$question, &$pageurl, &$quiz, $quiz_qbanktoo // Then list them. echo '