当前位置: 首页>>代码示例>>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;未经允许,请勿转载。