fixed missing userid

This commit is contained in:
Petr Skoda
2010-09-18 11:40:52 +00:00
parent 2be77520c9
commit caad849b33
+2 -2
View File
@@ -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.