protected $context;
protected $questionids; // All question ids in order that they appear in the quiz.
protected $pagequestionids; // array page no => array of questionids on the page in order.
-
+
// Fields set later if that data is needed.
protected $questions = null;
protected $accessmanager = null;
}
/**
- * @return boolean wether the current user is someone who previews the quiz,
+ * @return boolean wether the current user is someone who previews the quiz,
* rather than attempting it.
*/
public function is_preview_user() {
public function get_num_pages() {
return count($this->pagequestionids);
}
-
+
/**
* @param int $page page number
}
/**
- * Return the list of question ids for either a given page of the quiz, or for the
+ * Return the list of question ids for either a given page of the quiz, or for the
* whole quiz.
*
* @param mixed $page string 'all' or integer page number.
/**
* @return string the layout of this quiz. Used by number_questions to
- * work out which questions are on which pages.
+ * work out which questions are on which pages.
*/
protected function get_layout_string() {
return $this->quiz->questions;
/**
* Is this a student dealing with their own attempt/teacher previewing,
* or someone with 'mod/quiz:viewreports' reviewing someone elses attempt.
- *
+ *
* @return boolean whether this situation should be treated as someone looking at their own
* attempt. The distinction normally only matters when an attempt is being reviewed.
*/
global $USER;
return $this->attempt->userid == $USER->id &&
(!$this->is_preview_user() || $this->attempt->preview);
-
+
}
public function get_question_state($questionid) {
}
public function get_question_html_head_contributions($questionid) {
- return get_html_head_contributions(array($questionid),
+ $question_array = array($questionid);
+ return get_html_head_contributions($question_array,
$this->questions, $this->states);
}
/**
* @return string the layout of this quiz. Used by number_questions to
- * work out which questions are on which pages.
+ * work out which questions are on which pages.
*/
protected function get_layout_string() {
return $this->attempt->layout;
return $html;
}
}
-?>
\ No newline at end of file
+?>