From caad849b33dd0d3ab07034128d65b1e4e867dcdb Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 18 Sep 2010 11:40:52 +0000 Subject: [PATCH] fixed missing userid --- question/type/randomsamatch/questiontype.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/question/type/randomsamatch/questiontype.php b/question/type/randomsamatch/questiontype.php index a774f9ba368..b26027b65fd 100644 --- a/question/type/randomsamatch/questiontype.php +++ b/question/type/randomsamatch/questiontype.php @@ -80,7 +80,7 @@ class question_randomsamatch_qtype extends question_match_qtype { // 1. All questions that are explicitly assigned to the quiz // 2. All random questions // 3. All questions that are already chosen by an other random question - global $QTYPES, $OUTPUT; + global $QTYPES, $OUTPUT, $USER; if (!isset($cmoptions->questionsinuse)) { $cmoptions->questionsinuse = $cmoptions->questions; } @@ -97,7 +97,7 @@ class question_randomsamatch_qtype extends question_match_qtype { $count = count($saquestions); $wanted = $question->options->choose; $errorstr = ''; - if ($count < $wanted && has_coursecontact_role()) { //TODO: this teacher test is far from optimal + if ($count < $wanted && has_coursecontact_role($USER->id)) { //TODO: this teacher test is far from optimal if ($count >= 2) { $errorstr = "Error: could not get enough Short-Answer questions! Got $count Short-Answer questions, but wanted $wanted.