fixed missing userid
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user