本文整理汇总了PHP中quiz_question_preview_url函数的典型用法代码示例。如果您正苦于以下问题:PHP quiz_question_preview_url函数的具体用法?PHP quiz_question_preview_url怎么用?PHP quiz_question_preview_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quiz_question_preview_url函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quiz_question_preview_button
/**
* @param object $quiz the quiz settings
* @param object $question the question
* @param bool $label if true, show the preview question label after the icon
* @return the HTML for a preview question icon.
*/
function quiz_question_preview_button($quiz, $question, $label = false) {
global $CFG, $OUTPUT;
if (!question_has_capability_on($question, 'use', $question->category)) {
return '';
}
$url = quiz_question_preview_url($quiz, $question);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = get_string('preview', 'quiz');
}
// Build the icon.
$strpreviewquestion = get_string('previewquestion', 'quiz');
$image = $OUTPUT->pix_icon('t/preview', $strpreviewquestion);
$action = new popup_action('click', $url, 'questionpreview',
question_preview_popup_params());
return $OUTPUT->action_link($url, $image, $action, array('title' => $strpreviewquestion));
}
示例2: preview_question_url
public function preview_question_url($question) {
return quiz_question_preview_url($this->quiz, $question);
}
示例3: question_preview_icon
/**
* Render the preview icon.
*
* @param \stdClass $quiz the quiz settings from the database.
* @param \stdClass $question data from the question and quiz_slots tables.
* @param bool $label if true, show the preview question label after the icon
* @return string HTML to output.
*/
public function question_preview_icon($quiz, $question, $label = null)
{
$url = quiz_question_preview_url($quiz, $question);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = ' ' . get_string('preview', 'quiz');
}
// Build the icon.
$strpreviewquestion = get_string('previewquestion', 'quiz');
$image = $this->pix_icon('t/preview', $strpreviewquestion);
$action = new \popup_action('click', $url, 'questionpreview', question_preview_popup_params());
return $this->action_link($url, $image . $strpreviewlabel, $action, array('title' => $strpreviewquestion, 'class' => 'preview'));
}