本文整理汇总了PHP中question_preview_popup_params函数的典型用法代码示例。如果您正苦于以下问题:PHP question_preview_popup_params函数的具体用法?PHP question_preview_popup_params怎么用?PHP question_preview_popup_params使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了question_preview_popup_params函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: question_preview_link
/**
* Render an icon, optionally with the word 'Preview' beside it, to preview
* a given question.
* @param int $questionid the id of the question to be previewed.
* @param context $context the context in which the preview is happening.
* Must be a course or category context.
* @param bool $showlabel if true, show the word 'Preview' after the icon.
* If false, just show the icon.
*/
public function question_preview_link($questionid, context $context, $showlabel)
{
if ($showlabel) {
$alt = '';
$label = ' ' . get_string('preview');
$attributes = array();
} else {
$alt = get_string('preview');
$label = '';
$attributes = array('title' => $alt);
}
$image = $this->pix_icon('t/preview', $alt, '', array('class' => 'iconsmall'));
$link = question_preview_url($questionid, null, null, null, null, $context);
$action = new popup_action('click', $link, 'questionpreview', question_preview_popup_params());
return $this->action_link($link, $image . $label, $action, $attributes);
}
示例2: display_content
protected function display_content($question, $rowclasses) {
global $OUTPUT;
if (question_has_capability_on($question, 'use')) {
// Build the icon.
$image = $OUTPUT->pix_icon('t/preview', $this->strpreview, '', array('class' => 'iconsmall'));
$link = $this->qbank->preview_question_url($question);
$action = new popup_action('click', $link, 'questionpreview',
question_preview_popup_params());
echo $OUTPUT->action_link($link, $image, $action, array('title' => $this->strpreview));
}
}
示例3: 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));
}
示例4: 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'));
}