当前位置: 首页>>代码示例>>PHP>>正文


PHP quiz_question_preview_url函数代码示例

本文整理汇总了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));
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:locallib.php

示例2: preview_question_url

 public function preview_question_url($question) {
     return quiz_question_preview_url($this->quiz, $question);
 }
开发者ID:nigeli,项目名称:moodle,代码行数:3,代码来源:editlib.php

示例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'));
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:22,代码来源:edit_renderer.php


注:本文中的quiz_question_preview_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。