/** * Print a given single question in quiz for the reordertool tab of edit.php. * Meant to be used from quiz_print_question_list() * * @param object $question A question object from the database questions table * @param object $questionurl The url of the question editing page as a moodle_url object * @param object $quiz The quiz in the context of which the question is being displayed */ function quiz_print_singlequestion_reordertool($question, $returnurl, $quiz) { echo '<div class="singlequestion ' . $question->qtype . '">'; echo '<label for="s' . $question->id . '">'; echo print_question_icon($question); echo ' ' . quiz_question_tostring($question); echo '</label>'; echo '<span class="questionpreview">' . quiz_question_action_icons($quiz, $quiz->cmid, $question, $returnurl) . '</span>'; echo "</div>\n"; }
/** * Actions that can be performed on the question by this user (e.g. edit or preview). * @param \core_question\statistics\questions\calculated $questionstat stats for the question. * @return string contents of this table cell. */ protected function col_actions($questionstat) { return quiz_question_action_icons($this->quiz, $this->cmid, $questionstat->question, $this->baseurl); }
function col_actions($question){ global $CFG; $editreturnurl = str_replace($CFG->wwwroot, '', $this->baseurl); $editreturnurl = str_replace('&', '&', $editreturnurl); $editreturnurl = preg_replace('/&$/', '', $editreturnurl); return quiz_question_action_icons($this->quiz, $this->cmid, $question, $editreturnurl); }
function col_actions($question) { return quiz_question_action_icons($this->quiz, $this->cmid, $question, $this->baseurl); }