本文整理汇总了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;未经允许,请勿转载。 |
请发表评论