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

PHP MoodleQuickForm类代码示例

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

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



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

示例1:

 /**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 function definition_inner(&$mform)
 {
     //don't need these default elements :
     $mform->removeElement('defaultgrade');
     $mform->removeElement('penalty');
     $mform->addElement('hidden', 'defaultgrade', 0);
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:12,代码来源:edit_description_form.php


示例2: add_disabled_constraints_to_form

 /**
  * Add the disabledIf values.
  *
  * @param   MoodleQuickForm $mform      The form to add configuration to.
  */
 public static function add_disabled_constraints_to_form(\MoodleQuickForm $mform)
 {
     $myvalue = \tool_usertours\target::get_target_constant_for_class(get_class());
     foreach (array_keys(self::$forcedsettings) as $settingname) {
         $mform->disabledIf($settingname, 'targettype', 'eq', $myvalue);
     }
 }
开发者ID:dg711,项目名称:moodle,代码行数:12,代码来源:unattached.php


示例3: mform_autocomplete

 /**
  * Add autocomplete to a form text field
  *
  * @param MoodleQuickForm $mform Moodle form
  * @param array|moodle_url $options Array of autocomplete options, if $hiddenfieldname is
  *                       passed, array indexes are considered record IDs
  * @param string $textfieldname The text field's name
  * @param string $hiddenfieldname The hidden field's name.  If passed,
  *                                the option index will be set to this hidden
  *                                value when its option value is selected in
  *                                the text field
  * @param string $width The pixel width of the text field (Due to YUI, must
  *                      use width instead of size)
  * @return void
  * @link http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array.html What you get with no $hiddenfieldname
  * @link http://developer.yahoo.com/yui/examples/autocomplete/ac_itemselect.html What you get with $hiddenfieldname
  */
 public function mform_autocomplete($mform, $options, $textfieldname, $hiddenfieldname = '', $width = '300')
 {
     global $PAGE;
     $url = NULL;
     $data = NULL;
     // Generate data source
     if ($options instanceof moodle_url) {
         $url = $options->out(false);
     } else {
         $data = array();
         foreach ($options as $optionid => $option) {
             if (empty($hiddenfieldname)) {
                 $data[] = $option;
             } else {
                 $data[] = (object) array('text' => $option, 'id' => $optionid);
             }
         }
     }
     $fields = array('text');
     if (!empty($hiddenfieldname)) {
         $fields[] = 'id';
     }
     $module = array('name' => 'local_mr_framework', 'fullpath' => '/local/mr/framework/assets/javascript.js', 'requires' => array('yui2-yahoo', 'yui2-dom', 'yui2-event', 'yui2-datasource', 'yui2-json', 'yui2-connection', 'yui2-get', 'yui2-animation', 'yui2-autocomplete'));
     $arguments = array((object) array('fieldname' => $textfieldname, 'hiddenfieldname' => $hiddenfieldname, 'width' => $width, 'url' => $url, 'data' => $data, 'fields' => $fields));
     $PAGE->requires->js_init_call('M.local_mr.init_mr_html_autocomplete', $arguments, true, $module);
     // $PAGE->requires->css('/lib/yui/2.8.1/build/autocomplete/assets/autocomplete-core.css');
     // $PAGE->requires->css('/lib/yui/2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css');
     // Update form - need to force some attributes and add the javascript
     $mform->updateElementAttr($textfieldname, array('autocomplete' => 'off', 'style' => "width: {$width}px;"));
     // Add ID to hidden field so javascript can find it
     if (!empty($hiddenfieldname)) {
         $mform->updateElementAttr($hiddenfieldname, array('id' => "id_{$hiddenfieldname}"));
     }
 }
开发者ID:bgao-ca,项目名称:moodle-local_mr,代码行数:51,代码来源:html.php


示例4: specific_definition

 /**
  * @param MoodleQuickForm $mform
  */
 protected function specific_definition(MoodleQuickForm $mform)
 {
     $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
     $options = ['tree' => get_string('config_type_tree', 'block_activity_tree'), 'prev_next' => get_string('config_type_prev_next', 'block_activity_tree')];
     $mform->addElement('select', 'config_type', get_string('config_type', 'block_activity_tree'), $options);
     $mform->setDefault('config_type', 'tree');
 }
开发者ID:robologo3000,项目名称:block-activity-tree,代码行数:10,代码来源:edit_form.php


示例5: definition_inner

 /**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 protected function definition_inner($mform)
 {
     // We don't need this default element.
     $mform->removeElement('defaultmark');
     $mform->addElement('hidden', 'defaultmark', 0);
     $mform->setType('defaultmark', PARAM_RAW);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:12,代码来源:edit_description_form.php


示例6: get_form_elements

 /**
  * Get form elements for grading form
  *
  * @param stdClass $grade
  * @param MoodleQuickForm $mform
  * @param stdClass $data
  * @return bool true if elements were added to the form
  */
 public function get_form_elements($grade, MoodleQuickForm $mform, stdClass $data)
 {
     $fileoptions = $this->get_file_options();
     $gradeid = $grade ? $grade->id : 0;
     $data = file_prepare_standard_filemanager($data, 'files', $fileoptions, $this->assignment->get_context(), 'assignfeedback_file', ASSIGNFEEDBACK_FILE_FILEAREA, $gradeid);
     $mform->addElement('filemanager', 'files_filemanager', '', null, $fileoptions);
     return true;
 }
开发者ID:rama1712,项目名称:moodle,代码行数:16,代码来源:locallib.php


示例7: other_preference_fields

 protected function other_preference_fields(MoodleQuickForm $mform) {
     if (quiz_has_grades($this->_customdata['quiz'])) {
         $mform->addElement('selectyesno', 'slotmarks',
                 get_string('showdetailedmarks', 'quiz_overview'));
     } else {
         $mform->addElement('hidden', 'slotmarks', 0);
     }
 }
开发者ID:JP-Git,项目名称:moodle,代码行数:8,代码来源:overview_form.php


示例8: add_preflight_check_form_fields

 public function add_preflight_check_form_fields(mod_quiz_preflight_check_form $quizform, MoodleQuickForm $mform, $attemptid)
 {
     $mform->addElement('header', 'passwordheader', get_string('password'));
     $mform->addElement('static', 'passwordmessage', '', get_string('requirepasswordmessage', 'quizaccess_password'));
     // Don't use the 'proper' field name of 'password' since that get's
     // Firefox's password auto-complete over-excited.
     $mform->addElement('password', 'quizpassword', get_string('quizpassword', 'quizaccess_password'), array('autofocus' => 'true'));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:8,代码来源:rule.php


示例9: array

 /**
  * @param MoodleQuickForm $mform
  */
 function add_submit_buttons($mform)
 {
     $buttons = array();
     $buttons[] =& $mform->createElement('submit', 'submitbutton', get_string('filter', 'local_mr'));
     $buttons[] =& $mform->createElement('submit', 'resetbutton', get_string('reset', 'local_mr'));
     $mform->addGroup($buttons, 'buttons', '', array(' '), false);
     $mform->registerNoSubmitButton('reset');
 }
开发者ID:bgao-ca,项目名称:moodle-local_mr,代码行数:11,代码来源:filter.php


示例10: specific_definition

 /**
  * Extends the standard instance config form with custom
  * fields for moodletxt specifically
  * @param MoodleQuickForm $form Form to extend
  * @version 2011072201
  * @since 2011072201
  */
 protected function specific_definition($form)
 {
     // Section header title according to language file.
     $form->addElement('header', 'configheader', get_string('headerinstanceconfig', 'block_moodletxt'));
     // The title of the block
     $form->addElement('text', 'config_title', get_string('labelblocktitle', 'block_moodletxt'));
     $form->setDefault('config_title', get_string('blocktitle', 'block_moodletxt'));
     $form->setType('config_title', PARAM_MULTILANG);
 }
开发者ID:educacionbe,项目名称:campus,代码行数:16,代码来源:edit_form.php


示例11: create_cell_element

 /**
  * Create the form element used to define the weight of the cell
  * 
  * @param MoodleQuickForm   $form
  * @param int $row          row number
  * @param int $col          column number
  * @return object
  */
 public function create_cell_element($form, $row, $col, $multiple)
 {
     $cell_name = $this->cell_name($row, $col, $multiple);
     if ($multiple) {
         return $form->createElement('checkbox', $cell_name, 'label');
     } else {
         return $form->createElement('radio', $cell_name, '', '', $col);
     }
 }
开发者ID:sunilwebaccess,项目名称:moodle-question-matrix,代码行数:17,代码来源:qtype_matrix_grading.class.php


示例12: add_to_moodleform_testinput

 public function add_to_moodleform_testinput(MoodleQuickForm $mform)
 {
     $values = $this->get_choices();
     if (empty($values)) {
         $mform->addElement('static', $this->name, stack_string('ddl_empty'));
     } else {
         $mform->addElement('select', $this->name, $this->name, $values);
     }
 }
开发者ID:sowirepo,项目名称:moodle-qtype_stack,代码行数:9,代码来源:dropdown.class.php


示例13: 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


示例14: specific_definition

 /**
  * Builds the form to edit instance settings
  *
  * @param MoodleQuickForm $mform
  */
 protected function specific_definition($mform)
 {
     // Section header title according to language file.
     $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
     // Set the title for the block.
     $mform->addElement('text', 'config_title', get_string('configtitle', 'block_filtered_course_list'));
     $mform->setDefault('config_title', get_string('blockname', 'block_filtered_course_list'));
     $mform->setType('config_title', PARAM_TEXT);
 }
开发者ID:sharpchi,项目名称:moodle-blocks_filtered_course_list,代码行数:14,代码来源:edit_form.php


示例15: specific_definition

 /**
  * @param MoodleQuickForm $mform
  */
 protected function specific_definition($mform)
 {
     // Section header title according to language file.
     $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
     // A sample string variable with a default value.
     $mform->addElement('text', 'config_text', get_string('blockstring', 'block_simplehtml'));
     $mform->setDefault('config_text', 'default value');
     $mform->setType('config_text', PARAM_RAW);
 }
开发者ID:MoobiEgc,项目名称:webgd_community,代码行数:12,代码来源:edit_form.php


示例16: add_filter_to_form

 /**
  * Add the form elements for the filter to the supplied form.
  *
  * @param   MoodleQuickForm $mform      The form to add filter settings to.
  */
 public static function add_filter_to_form(\MoodleQuickForm &$mform)
 {
     $options = [static::ANYVALUE => get_string('all')];
     $options += static::get_filter_options();
     $filtername = static::get_filter_name();
     $key = "filter_{$filtername}";
     $mform->addElement('select', $key, get_string($key, 'tool_usertours'), $options, ['multiple' => true]);
     $mform->setDefault($key, static::ANYVALUE);
     $mform->addHelpButton($key, $key, 'tool_usertours');
 }
开发者ID:dg711,项目名称:moodle,代码行数:15,代码来源:base.php


示例17: get_form_elements

 /**
  * Get form elements for the grading page
  *
  * @param stdClass|null $grade
  * @param MoodleQuickForm $mform
  * @param stdClass $data
  * @return bool true if elements were added to the form
  */
 public function get_form_elements($grade, MoodleQuickForm $mform, stdClass $data)
 {
     $choices = get_string_manager()->get_list_of_countries();
     $choices = array('' => get_string('selectacountry') . '...') + $choices;
     $mform->addElement('select', 'country', 'Country for E-signature', $choices);
     $mform->addElement('static', 'description', '', get_string('savechanges', 'assignfeedback_esign'));
     $mform->setDefault('country', 'SE');
     $mform->addRule('country', get_string('selectacountry'), 'required', '', 'client', false, false);
     return true;
 }
开发者ID:dsv-su,项目名称:moodle-assignfeedback_esign,代码行数:18,代码来源:locallib.php


示例18: 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


示例19: get_form_elements

    /**
     * Get form elements for the grading page
     *
     * @param stdClass|null $grade
     * @param MoodleQuickForm $mform
     * @param stdClass $data
     * @return bool true if elements were added to the form
     */
    public function get_form_elements($grade, MoodleQuickForm $mform, stdClass $data) {
        if ($grade) {
            $feedbackcomments = $this->get_feedback_comments($grade->id);
            if ($feedbackcomments) {
                $data->assignfeedbackcomments_editor['text'] = $feedbackcomments->commenttext;
                $data->assignfeedbackcomments_editor['format'] = $feedbackcomments->commentformat;
            }
        }

        $mform->addElement('editor', 'assignfeedbackcomments_editor', '', null, null);
        return true;
    }
开发者ID:nicusX,项目名称:moodle,代码行数:20,代码来源:locallib.php


示例20: other_preference_fields

 protected function other_preference_fields(MoodleQuickForm $mform)
 {
     $mform->addGroup(array($mform->createElement('advcheckbox', 'qtext', '', get_string('questiontext', 'quiz_responses')), $mform->createElement('advcheckbox', 'resp', '', get_string('response', 'quiz_responses')), $mform->createElement('advcheckbox', 'right', '', get_string('rightanswer', 'quiz_responses'))), 'coloptions', get_string('showthe', 'quiz_responses'), array(' '), false);
     $mform->disabledIf('qtext', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
     $mform->disabledIf('resp', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
     $mform->disabledIf('right', 'attempts', 'eq', quiz_attempts_report::ENROLLED_WITHOUT);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:7,代码来源:responses_form.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Movie类代码示例发布时间:2022-05-23
下一篇:
PHP MoodleODSWorkbook类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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