當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。