/** * Print a given single question in quiz for the edit 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 $returnurl The url to get back to this page, for example after editing. * @param object $quiz The quiz in the context of which the question is being displayed */ function quiz_print_singlequestion($question, $returnurl, $quiz) { echo '<div class="singlequestion ' . $question->qtype . '">'; echo quiz_question_edit_button($quiz->cmid, $question, $returnurl, quiz_question_tostring($question) . ' '); echo '<span class="questiontype">'; echo print_question_icon($question); echo ' ' . question_bank::get_qtype_name($question->qtype) . '</span>'; echo '<span class="questionpreview">' . quiz_question_preview_button($quiz, $question, true) . '</span>'; echo "</div>\n"; }
/** * @param object $quiz the quiz. * @param int $cmid the course_module object for this quiz. * @param object $question the question. * @param string $returnurl url to return to after action is done. * @return string html for a number of icons linked to action pages for a * question - preview and edit / view icons depending on user capabilities. */ function quiz_question_action_icons($quiz, $cmid, $question, $returnurl) { $html = quiz_question_preview_button($quiz, $question) . ' ' . quiz_question_edit_button($cmid, $question, $returnurl); return $html; }
/** * Print a given single question in quiz for the edit 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 $returnurl The url to get back to this page, for example after editing. * @param object $quiz The quiz in the context of which the question is being displayed */ function quiz_print_singlequestion($question, $returnurl, $quiz) { global $QTYPES; echo '<div class="singlequestion">'; echo quiz_question_edit_button($quiz->cmid, $question, $returnurl, quiz_question_tostring($question) . ' '); echo '<span class="questiontype">'; $namestr = $QTYPES[$question->qtype]->local_name(); print_question_icon($question); echo " {$namestr}</span>"; echo '<span class="questionpreview">' . quiz_question_preview_button($quiz, $question, true) . '</span>'; echo "</div>\n"; }
/** * @param object $quiz the quiz. * @param int $cmid the course_module object for this quiz. * @param object $question the question. * @param string $returnurl url to return to after action is done. * @param int $variant which question variant to preview (optional). * @return string html for a number of icons linked to action pages for a * question - preview and edit / view icons depending on user capabilities. */ function quiz_question_action_icons($quiz, $cmid, $question, $returnurl, $variant = null) { $html = quiz_question_preview_button($quiz, $question, false, $variant) . ' ' . quiz_question_edit_button($cmid, $question, $returnurl); return $html; }