當前位置: 首頁>>代碼示例>>PHP>>正文


PHP question_attempt::get_step方法代碼示例

本文整理匯總了PHP中question_attempt::get_step方法的典型用法代碼示例。如果您正苦於以下問題:PHP question_attempt::get_step方法的具體用法?PHP question_attempt::get_step怎麽用?PHP question_attempt::get_step使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在question_attempt的用法示例。


在下文中一共展示了question_attempt::get_step方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: formulation_and_controls

 public function formulation_and_controls(question_attempt $qa, question_display_options $options)
 {
     global $PAGE;
     $question = $qa->get_question();
     if ($question->answerdisplay == "dragdrop") {
         $PAGE->requires->js('/question/type/gapfill/jquery/jquery-1.4.2.js');
         $PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.core.min.js');
         $PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.widget.min.js');
         $PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.mouse.min.js');
         $PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.draggable.min.js');
         $PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.droppable.min.js');
         $PAGE->requires->js('/question/type/gapfill/dragdrop.js');
     }
     $answers = $qa->get_step(0)->get_qt_var('_allanswers');
     $output = '';
     if ($question->answerdisplay == "dragdrop") {
         $ddclass = " draggable answers ";
         $answers = $this->get_answers('dragdrop', $answers);
         foreach ($answers as $value) {
             $output .= '<span class="' . $ddclass . '">' . $value . "</span>&nbsp";
         }
         $output .= "</br></br>";
     }
     $marked_gaps = $question->get_marked_gaps($qa, $options);
     foreach ($question->textfragments as $place => $fragment) {
         if ($place > 0) {
             $output .= $this->embedded_element($qa, $place, $options, $marked_gaps);
         }
         /* format the non entry field parts of the question text, this will also
            ensure images get displayed */
         $output .= $question->format_text($fragment, $question->questiontextformat, $qa, 'question', 'questiontext', $question->id);
     }
     print "<br/>";
     if ($qa->get_state() == question_state::$invalid) {
         $output .= html_writer::nonempty_tag('div', $question->get_validation_error(array('answer' => $output)), array('class' => 'validationerror'));
     }
     return $output;
 }
開發者ID:dthies,項目名稱:moodle-qtype_gapfill,代碼行數:38,代碼來源:renderer.php

示例2: init_order

 protected function init_order(question_attempt $qa)
 {
     if (is_null($this->order)) {
         $this->order = explode(',', $qa->get_step(0)->get_qt_var('_order'));
     }
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:6,代碼來源:question.php

示例3: notify_metadata_modified

 public function notify_metadata_modified(question_attempt $qa, $name)
 {
     if (array_key_exists($qa->get_slot(), $this->attemptsadded)) {
         return;
     }
     if ($this->is_step_added($qa->get_step(0)) !== false) {
         return;
     }
     if (isset($this->metadataadded[$qa->get_slot()][$name])) {
         return;
     }
     if (isset($this->metadatamodified[$qa->get_slot()][$name])) {
         return;
     }
     $this->metadatamodified[$qa->get_slot()][$name] = $qa;
 }
開發者ID:alanaipe2015,項目名稱:moodle,代碼行數:16,代碼來源:datalib.php


注:本文中的question_attempt::get_step方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。