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


PHP MoodleQuickForm::closeHeaderBefore方法代码示例

本文整理汇总了PHP中MoodleQuickForm::closeHeaderBefore方法的典型用法代码示例。如果您正苦于以下问题:PHP MoodleQuickForm::closeHeaderBefore方法的具体用法?PHP MoodleQuickForm::closeHeaderBefore怎么用?PHP MoodleQuickForm::closeHeaderBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MoodleQuickForm的用法示例。


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

示例1: array

 /**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 function definition_inner(&$mform)
 {
     $menu = array(get_string('caseno', 'quiz'), get_string('caseyes', 'quiz'));
     $mform->addElement('select', 'usecase', get_string('casesensitive', 'quiz'), $menu);
     $mform->addElement('static', 'answersinstruct', get_string('correctanswers', 'quiz'), get_string('filloutoneanswer', 'quiz'));
     $mform->closeHeaderBefore('answersinstruct');
     $creategrades = get_grade_options();
     $gradeoptions = $creategrades->gradeoptions;
     $repeated = array();
     $repeated[] =& $mform->createElement('header', 'answerhdr', get_string('answerno', 'qtype_shortanswer', '{no}'));
     $repeated[] =& $mform->createElement('text', 'answer', get_string('answer', 'quiz'), array('size' => 54));
     $repeated[] =& $mform->createElement('select', 'fraction', get_string('grade'), $gradeoptions);
     $repeated[] =& $mform->createElement('htmleditor', 'feedback', get_string('feedback', 'quiz'), array('course' => $this->coursefilesid));
     if (isset($this->question->options)) {
         $countanswers = count($this->question->options->answers);
     } else {
         $countanswers = 0;
     }
     if ($this->question->formoptions->repeatelements) {
         $repeatsatstart = QUESTION_NUMANS_START > $countanswers + QUESTION_NUMANS_ADD ? QUESTION_NUMANS_START : $countanswers + QUESTION_NUMANS_ADD;
     } else {
         $repeatsatstart = $countanswers;
     }
     $repeatedoptions = array();
     $mform->setType('answer', PARAM_RAW);
     $repeatedoptions['fraction']['default'] = 0;
     $this->repeat_elements($repeated, $repeatsatstart, $repeatedoptions, 'noanswers', 'addanswers', QUESTION_NUMANS_ADD, get_string('addmoreanswerblanks', 'qtype_shortanswer'));
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:33,代码来源:edit_shortanswer_form.php

示例2: array

 /**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 function definition_inner(&$mform)
 {
     $menu = array(get_string('caseno', 'quiz'), get_string('caseyes', 'quiz'));
     $mform->addElement('select', 'usecase', get_string('casesensitive', 'quiz'), $menu);
     $mform->addElement('static', 'answersinstruct', get_string('correctanswers', 'quiz'), get_string('filloutoneanswer', 'quiz'));
     $mform->closeHeaderBefore('answersinstruct');
     $creategrades = get_grade_options();
     $this->add_per_answer_fields($mform, get_string('answerno', 'qtype_shortanswer', '{no}'), $creategrades->gradeoptions);
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:14,代码来源:edit_shortanswer_form.php

示例3: definition_inner

 /**
  * definition_inner adds all specific fields to the form.
  *
  * @param MoodleQuickForm $mform (the form being built).
  */
 protected function definition_inner($mform)
 {
     $mform->addElement('header', 'previewareaheader', get_string('previewareaheader', 'qtype_' . $this->qtype()));
     $mform->setExpanded('previewareaheader');
     $mform->addElement('static', 'previewarea', '', get_string('previewareamessage', 'qtype_' . $this->qtype()));
     $mform->registerNoSubmitButton('refresh');
     $mform->addElement('submit', 'refresh', get_string('refresh', 'qtype_' . $this->qtype()));
     $mform->addElement('filepicker', 'bgimage', get_string('bgimage', 'qtype_' . $this->qtype()), null, self::file_picker_options());
     $mform->closeHeaderBefore('dropzoneheader');
     // Add the draggable image fields & drop zones to the form.
     list($itemrepeatsatstart, $imagerepeats) = $this->get_drag_item_repeats();
     $this->definition_draggable_items($mform, $itemrepeatsatstart);
     $this->definition_drop_zones($mform, $imagerepeats);
     $this->add_combined_feedback_fields(true);
     $this->add_interactive_settings(true, true);
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:21,代码来源:edit_ddtoimage_form_base.php

示例4: add_navigation_buttons

 /**
  * Add Previous/Next buttons to a formslib form.
  *
  * @param MoodleQuickForm $mform the MoodleQuickForm object (that is,
  * $form->_form) to add the buttons to
  * @param string $prevstep the ID of the previous step
  * @param string $nextstep the ID of the next step.  If null, go to the
  * next step as defined by the workflow.  If it is workflow::STEP_FINISH,
  * it will submit call the workflow's finish method, rather than the save
  * method.
  * @param string $nextlabel the label for the Next button.  If null,
  * default to the language string for "Next" (or "Finish").
  */
 public static function add_navigation_buttons(MoodleQuickForm $mform, $prevstep = null, $nextstep = null, $nextlabel = null)
 {
     global $CFG;
     require_once $CFG->dirroot . '/elis/core/lib/form/xbutton.php';
     $buttonarray = array();
     $cancelbutton = $mform->createElement('xbutton', 'action', get_string('cancel'), array('value' => 'cancel', 'type' => 'submit'));
     $buttonarray[] = $cancelbutton;
     if ($nextstep === workflow::STEP_FINISH) {
         if ($prevstep) {
             $prevbutton = $mform->createElement('xbutton', '_step', get_string('previous'), array('value' => $prevstep, 'type' => 'submit'));
             $buttonarray[] = $prevbutton;
         }
         $nextbutton = $mform->createElement('xbutton', 'action', $nextlabel === null ? get_string('finish', 'elis_core') : $nextlabel, array('value' => 'finish', 'type' => 'submit'));
     } else {
         if ($prevstep) {
             $prevbutton = $mform->createElement('xbutton', '_next_step', get_string('previous'), array('value' => $prevstep, 'type' => 'submit'));
             $buttonarray[] = $prevbutton;
         }
         $nextbutton = $mform->createElement('xbutton', $nextstep === null ? '' : '_next_step', $nextlabel === null ? get_string('next') : $nextlabel, array('value' => $nextstep, 'type' => 'submit'));
     }
     $buttonarray[] = $nextbutton;
     $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
     $mform->closeHeaderBefore('buttonar');
 }
开发者ID:benavidesrobert,项目名称:elis.base,代码行数:37,代码来源:workflowpage.class.php

示例5: array

 /**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 function definition_inner(&$mform)
 {
     // Add the select control which will select the comparison type to use
     $mform->addElement('select', 'compareby', get_string('compareby', 'qtype_algebra'), array("sage" => get_string('comparesage', 'qtype_algebra'), "eval" => get_string('compareeval', 'qtype_algebra'), "equiv" => get_string('compareequiv', 'qtype_algebra')));
     $mform->setDefault('compareby', 'eval');
     $mform->setHelpButton('compareby', array('comp_algorithm', get_string('compalgorithm', 'qtype_algebra'), 'qtype_algebra'));
     // Add the control to select the number of checks to perform
     // First create an array with all the allowed values. We will then use this array
     // with the array_combine function to create a single array where the keys are the
     // same as the array values
     $chk_array = array('1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '200', '300', '500', '700', '1000');
     // Add the select element using the array_combine method discussed above
     $mform->addElement('select', 'nchecks', get_string('nchecks', 'qtype_algebra'), array_combine($chk_array, $chk_array));
     // Set the default number of checks to perform
     $mform->setDefault('nchecks', '10');
     $mform->setHelpButton('nchecks', array('eval_checks', get_string('evalchecks', 'qtype_algebra'), 'qtype_algebra'));
     // Add the box to set the tolerance to use when performing evaluation checks
     $mform->addElement('text', 'tolerance', get_string('tolerance', 'qtype_algebra'));
     $mform->setType('tolerance', PARAM_NUMBER);
     $mform->setDefault('tolerance', '0.001');
     $mform->setHelpButton('tolerance', array('check_tolerance', get_string('checktolerance', 'qtype_algebra'), 'qtype_algebra'));
     // Add an entry for the answer box prefix
     $mform->addElement('text', 'answerprefix', get_string('answerprefix', 'qtype_algebra'), array('size' => 55));
     $mform->setType('answerprefix', PARAM_RAW);
     $mform->setHelpButton('answerprefix', array('answer_prefix', get_string('answerboxprefix', 'qtype_algebra'), 'qtype_algebra'));
     // Add an entry for a disallowed expression
     $mform->addElement('text', 'disallow', get_string('disallow', 'qtype_algebra'), array('size' => 55));
     $mform->setType('disallow', PARAM_RAW);
     $mform->setHelpButton('disallow', array('disallowed_ans', get_string('disallowanswer', 'qtype_algebra'), 'qtype_algebra'));
     // Create an array which will store the function checkboxes
     $func_group = array();
     // Create an array to add spacers between the boxes
     $spacers = array('<br>');
     // Add the initial all functions box to the list of check boxes
     $func_group[] =& $mform->createElement('checkbox', 'all', '', get_string('allfunctions', 'qtype_algebra'));
     // Create a checkbox element for each function understood by the parser
     for ($i = 0; $i < count(qtype_algebra_parser::$functions); $i++) {
         $func = qtype_algebra_parser::$functions[$i];
         $func_group[] =& $mform->createElement('checkbox', $func, '', $func);
         if ($i % 6 == 5) {
             $spacers[] = '<br>';
         } else {
             $spacers[] = str_repeat('&nbsp;', 8 - strlen($func));
         }
     }
     // Create and add the group of function controls to the form
     $mform->addGroup($func_group, 'allowedfuncs', get_string('allowedfuncs', 'qtype_algebra'), $spacers, true);
     $mform->disabledIf('allowedfuncs', 'allowedfuncs[all]', 'checked');
     $mform->setDefault('allowedfuncs[all]', 'checked');
     $mform->setHelpButton('allowedfuncs', array('allowed_funcs', get_string('allowedfunctions', 'qtype_algebra'), 'qtype_algebra'));
     // Create the array for the list of variables used in the question
     $repeated = array();
     // Create the array for the list of repeated options used by the variable subforms
     $repeatedoptions = array();
     // Add the form elements to enter the variables
     $repeated[] =& $mform->createElement('header', 'variablehdr', get_string('variableno', 'qtype_algebra', '{no}'));
     $repeatedoptions['variablehdr']['helpbutton'] = array('variable', get_string('variable', 'qtype_algebra'), 'qtype_algebra');
     $repeated[] =& $mform->createElement('text', 'variable', get_string('variablename', 'qtype_algebra'), array('size' => 20));
     $mform->setType('variable', PARAM_RAW);
     $repeated[] =& $mform->createElement('text', 'varmin', get_string('varmin', 'qtype_algebra'), array('size' => 20));
     $mform->setType('varmin', PARAM_RAW);
     $repeatedoptions['varmin']['default'] = '';
     $repeated[] =& $mform->createElement('text', 'varmax', get_string('varmax', 'qtype_algebra'), array('size' => 20));
     $mform->setType('varmax', PARAM_RAW);
     $repeatedoptions['varmax']['default'] = '';
     // Get the current number of variables defined, if any
     if (isset($this->question->options)) {
         $countvars = count($this->question->options->variables);
     } else {
         $countvars = 0;
     }
     // Come up with the number of variable entries to add to the form at the start
     if ($this->question->formoptions->repeatelements) {
         $repeatsatstart = SYMB_QUESTION_NUMVAR_START > $countvars + SYMB_QUESTION_NUMVAR_ADD ? SYMB_QUESTION_NUMVAR_START : $countvars + SYMB_QUESTION_NUMVAR_ADD;
     } else {
         $repeatsatstart = $countvars;
     }
     $this->repeat_elements($repeated, $repeatsatstart, $repeatedoptions, 'novariables', 'addvariables', SYMB_QUESTION_NUMVAR_ADD, get_string('addmorevariableblanks', 'qtype_algebra'));
     // Add the instructions for entering answers to the question
     $mform->addElement('static', 'answersinstruct', get_string('correctanswers', 'quiz'), get_string('filloutoneanswer', 'quiz'));
     $mform->closeHeaderBefore('answersinstruct');
     $creategrades = get_grade_options();
     $gradeoptions = $creategrades->gradeoptions;
     $repeated = array();
     $repeated[] =& $mform->createElement('header', 'answerhdr', get_string('answerno', 'qtype_algebra', '{no}'));
     $repeated[] =& $mform->createElement('text', 'answer', get_string('answer', 'quiz'), array('size' => 54));
     $repeated[] =& $mform->createElement('select', 'fraction', get_string('grade'), $gradeoptions);
     $repeated[] =& $mform->createElement('htmleditor', 'feedback', get_string('feedback', 'quiz'), array('course' => $this->coursefilesid));
     if (isset($this->question->options)) {
         $countanswers = count($this->question->options->answers);
     } else {
         $countanswers = 0;
     }
     if ($this->question->formoptions->repeatelements) {
         $repeatsatstart = SYMB_QUESTION_NUMANS_START > $countanswers + SYMB_QUESTION_NUMANS_ADD ? SYMB_QUESTION_NUMANS_START : $countanswers + SYMB_QUESTION_NUMANS_ADD;
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:edit_algebra_form.php

示例6: add_navigation_buttons

 /**
  * Add Previous/Next buttons to a formslib form.
  *
  * @param MoodleQuickForm $mform the MoodleQuickForm object (that is,
  * $form->_form) to add the buttons to
  * @param string $prevstep the ID of the previous step
  * @param string $nextstep the ID of the next step.  If null, go to the
  * next step as defined by the workflow.  If it is workflow::STEP_FINISH,
  * it will submit call the workflow's finish method, rather than the save
  * method.
  * @param string $nextlabel the label for the Next button.  If null,
  * default to the language string for "Next" (or "Finish").
  * @uses $CFG
  * @uses $FULLME
  */
 public static function add_navigation_buttons(MoodleQuickForm $mform, $prevstep = null, $nextstep = null, $nextlabel = null)
 {
     global $CFG, $FULLME;
     require_once $CFG->dirroot . '/local/eliscore/lib/form/xbutton.php';
     // ELIS-3501: Previous button was broken in IE7, changed to onclick
     $target = null;
     if ($prevstep && ($workflow_id = optional_param('_wfid', 0, PARAM_INT))) {
         $target = new moodle_url($FULLME, array('_wfid' => $workflow_id, '_step' => $prevstep));
         $target = $target->out(false);
     }
     $buttonarray = array();
     $cancelbutton = $mform->createElement('xbutton', 'action', get_string('cancel'), array('value' => 'cancel', 'type' => 'submit'));
     $buttonarray[] = $cancelbutton;
     if ($nextstep === workflow::STEP_FINISH) {
         if ($target) {
             $prevbutton = $mform->createElement('xbutton', 'previous', get_string('previous'), array('value' => $prevstep, 'type' => 'button', 'onclick' => "window.location = '{$target}';"));
             $buttonarray[] = $prevbutton;
         }
         $nextbutton = $mform->createElement('xbutton', 'action', $nextlabel === null ? get_string('finish', 'local_eliscore') : $nextlabel, array('value' => 'finish', 'type' => 'submit'));
     } else {
         if ($target) {
             $prevbutton = $mform->createElement('xbutton', 'previous', get_string('previous'), array('value' => $prevstep, 'type' => 'button', 'onclick' => "window.location = '{$target}';"));
             $buttonarray[] = $prevbutton;
         }
         $nextbutton = $mform->createElement('xbutton', $nextstep === null ? '' : '_next_step', $nextlabel === null ? get_string('next') : $nextlabel, array('value' => $nextstep, 'type' => 'submit'));
     }
     $buttonarray[] = $nextbutton;
     $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
     $mform->closeHeaderBefore('buttonar');
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:45,代码来源:workflowpage.class.php


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