• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP print_choose_qtype_to_add_form函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中print_choose_qtype_to_add_form函数的典型用法代码示例。如果您正苦于以下问题:PHP print_choose_qtype_to_add_form函数的具体用法?PHP print_choose_qtype_to_add_form怎么用?PHP print_choose_qtype_to_add_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了print_choose_qtype_to_add_form函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: require_capability

require_capability('moodle/question:add', $categorycontext);
// Ensure other optional params get passed on to question.php.
if (!empty($returnurl)) {
    $hiddenparams['returnurl'] = $returnurl;
}
if (!empty($appendqnumstring)) {
    $hiddenparams['appendqnumstring'] = $appendqnumstring;
}
$PAGE->set_url('/question/addquestion.php', $hiddenparams);
$chooseqtype = get_string('chooseqtypetoadd', 'question');
$PAGE->set_heading($COURSE->fullname);
if ($cm !== null) {
    // Nasty hack, but we don't want this link if returnurl returns to view.php
    if (stripos($returnurl, "/mod/{$cm->modname}/view.php") !== 0) {
        $PAGE->navbar->add(get_string('editinga', 'moodle', get_string('modulename', $cm->modname)), $returnurl);
    }
    $PAGE->navbar->add($chooseqtype);
    $PAGE->set_title($chooseqtype);
    echo $OUTPUT->header();
} else {
    $PAGE->navbar->add(get_string('questionbank', 'question'), $returnurl);
    $PAGE->navbar->add($chooseqtype);
    $PAGE->set_title($chooseqtype);
    echo $OUTPUT->header();
}
// Display a form to choose the question type.
echo $OUTPUT->notification(get_string('youmustselectaqtype', 'question'));
echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox');
print_choose_qtype_to_add_form($hiddenparams);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:addquestion.php


示例2: create_new_question_button

/**
 * Print a button for creating a new question. This will open question/addquestion.php,
 * which in turn goes to question/question.php before getting back to $params['returnurl']
 * (by default the question bank screen).
 *
 * @param int $categoryid The id of the category that the new question should be added to.
 * @param array $params Other paramters to add to the URL. You need either $params['cmid'] or
 *      $params['courseid'], and you should probably set $params['returnurl']
 * @param string $caption the text to display on the button.
 * @param string $tooltip a tooltip to add to the button (optional).
 * @param bool $disabled if true, the button will be disabled.
 */
function create_new_question_button($categoryid, $params, $caption, $tooltip = '', $disabled = false)
{
    global $CFG, $PAGE, $OUTPUT;
    static $choiceformprinted = false;
    $params['category'] = $categoryid;
    $url = new moodle_url('/question/addquestion.php', $params);
    echo $OUTPUT->single_button($url, $caption, 'get', array('disabled' => $disabled, 'title' => $tooltip));
    if (!$choiceformprinted) {
        echo '<div id="qtypechoicecontainer">';
        echo print_choose_qtype_to_add_form(array());
        echo "</div>\n";
        $choiceformprinted = true;
    }
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:26,代码来源:editlib.php


示例3: print_error

        print_error('missingcourseorcmid', 'question');
    }
}
// Check permissions.
$categorycontext = context::instance_by_id($category->contextid);
require_capability('moodle/question:add', $categorycontext);
// Ensure other optional params get passed on to question.php.
if (!empty($returnurl)) {
    $hiddenparams['returnurl'] = $returnurl;
}
if (!empty($appendqnumstring)) {
    $hiddenparams['appendqnumstring'] = $appendqnumstring;
}
$PAGE->set_url('/question/addquestion.php', $hiddenparams);
if ($cmid) {
    $questionbankurl = new moodle_url('/question/edit.php', array('cmid' => $cmid));
} else {
    $questionbankurl = new moodle_url('/question/edit.php', array('courseid' => $courseid));
}
navigation_node::override_active_url($questionbankurl);
$chooseqtype = get_string('chooseqtypetoadd', 'question');
$PAGE->set_heading($COURSE->fullname);
$PAGE->navbar->add($chooseqtype);
$PAGE->set_title($chooseqtype);
// Display a form to choose the question type.
echo $OUTPUT->header();
echo $OUTPUT->notification(get_string('youmustselectaqtype', 'question'));
echo $OUTPUT->box_start('generalbox boxwidthnormal boxaligncenter', 'chooseqtypebox');
print_choose_qtype_to_add_form($hiddenparams, null, false);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:addquestion.php


示例4: question_chooser

 /**
  * Render the question type chooser dialogue.
  * @return string HTML to output.
  */
 public function question_chooser()
 {
     $container = html_writer::div(print_choose_qtype_to_add_form(array(), null, false), '', array('id' => 'qtypechoicecontainer'));
     return html_writer::div($container, 'createnewquestion');
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:9,代码来源:edit_renderer.php


示例5: create_new_question_button

/**
 * Print a button for creating a new question. This will open question/addquestion.php,
 * which in turn goes to question/question.php before getting back to $params['returnurl']
 * (by default the question bank screen).
 *
 * @param integer $categoryid The id of the category that the new question should be added to.
 * @param array $params Other paramters to add to the URL. You need either $params['cmid'] or
 *      $params['courseid'], and you should probably set $params['returnurl']
 * @param string $caption the text to display on the button.
 * @param string $tooltip a tooltip to add to the button (optional).
 * @param boolean $disabled if true, the button will be disabled.
 */
function create_new_question_button($categoryid, $params, $caption, $tooltip = '', $disabled = false)
{
    global $CFG;
    static $choiceformprinted = false;
    $params['category'] = $categoryid;
    print_single_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption, 'get', '', false, $tooltip, $disabled);
    helpbutton('types', get_string('createnewquestion', 'question'), 'question');
    require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_dragdrop', 'yui_container'));
    if (!$choiceformprinted) {
        echo '<div id="qtypechoicecontainer">';
        print_choose_qtype_to_add_form(array());
        echo "</div>\n";
        $choiceformprinted = true;
    }
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:27,代码来源:editlib.php


示例6: create_new_question_button

/**
 * Print a button for creating a new question. This will open question/addquestion.php,
 * which in turn goes to question/question.php before getting back to $params['returnurl']
 * (by default the question bank screen).
 *
 * @param integer $categoryid The id of the category that the new question should be added to.
 * @param array $params Other paramters to add to the URL. You need either $params['cmid'] or
 *      $params['courseid'], and you should probably set $params['returnurl']
 * @param string $caption the text to display on the button.
 * @param string $tooltip a tooltip to add to the button (optional).
 * @param boolean $disabled if true, the button will be disabled.
 */
function create_new_question_button($categoryid, $params, $caption, $tooltip = '', $disabled = false)
{
    global $CFG, $PAGE, $OUTPUT;
    static $choiceformprinted = false;
    $params['category'] = $categoryid;
    $form = html_form::make_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption, 'get');
    $form->button->title = $tooltip;
    $form->button->disabled = $disabled;
    echo $OUTPUT->button($form);
    echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
    $PAGE->requires->yui_lib('dragdrop');
    $PAGE->requires->yui_lib('container');
    if (!$choiceformprinted) {
        echo '<div id="qtypechoicecontainer">';
        print_choose_qtype_to_add_form(array());
        echo "</div>\n";
        $choiceformprinted = true;
    }
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:editlib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP print_chooser_row函数代码示例发布时间:2022-05-15
下一篇:
PHP print_checkbox_row函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap