當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。