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


PHP question_edit_form::data_preprocessing_answers方法代码示例

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


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

示例1: data_preprocessing_answers

    protected function data_preprocessing_answers($question) {
        $question = parent::data_preprocessing_answers($question);
        if (empty($question->options->answers)) {
            return $question;
        }

        $key = 0;
        foreach ($question->options->answers as $answer) {
            // See comment in the parent method about this hack.
            unset($this->_form->_defaultValues["tolerance[$key]"]);

            $question->tolerance[$key] = $answer->tolerance;
            $key++;
        }

        return $question;
    }
开发者ID:nottmoo,项目名称:moodle,代码行数:17,代码来源:edit_numerical_form.php

示例2: data_preprocessing_answers

 protected function data_preprocessing_answers($question, $withanswerfiles = false)
 {
     $question = parent::data_preprocessing_answers($question, $withanswerfiles);
     if (empty($question->options->answers)) {
         return $question;
     }
     $key = 0;
     foreach ($question->options->answers as $answer) {
         // See comment in the parent method about this hack.
         unset($this->_form->_defaultValues["tolerance[{$key}]"]);
         unset($this->_form->_defaultValues["tolerancetype[{$key}]"]);
         unset($this->_form->_defaultValues["correctanswerlength[{$key}]"]);
         unset($this->_form->_defaultValues["correctanswerformat[{$key}]"]);
         $question->tolerance[$key] = $answer->tolerance;
         $question->tolerancetype[$key] = $answer->tolerancetype;
         $question->correctanswerlength[$key] = $answer->correctanswerlength;
         $question->correctanswerformat[$key] = $answer->correctanswerformat;
         $key++;
     }
     return $question;
 }
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:21,代码来源:edit_calculatedmulti_form.php

示例3: data_preprocessing_answers

 protected function data_preprocessing_answers($question, $withanswerfiles = false)
 {
     parent::data_preprocessing_answers($question, $withanswerfiles);
     $key = 0;
     foreach ($question->options->answers as $answer) {
         // Prepare the answersound filemanager to display files in draft area.
         $draftitemid = file_get_submitted_draft_itemid('answersound[' . $key . ']');
         file_prepare_draft_area($draftitemid, 1, 'question', 'answersound', $answer->id);
         $question->answersound[$key] = $draftitemid;
         // Prepare the feedbacksound filemanager to display files in draft area.
         $draftitemid = file_get_submitted_draft_itemid('feedbacksound[' . $key . ']');
         file_prepare_draft_area($draftitemid, 1, 'question', 'feedbacksound', $answer->id);
         $question->feedbacksound[$key] = $draftitemid;
         $key++;
     }
     return $question;
 }
开发者ID:edwinphillips,项目名称:turmultiplechoice_2.2,代码行数:17,代码来源:edit_turmultiplechoice_form.php


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