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


PHP question_engine::get_behaviour_unused_display_options方法代码示例

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


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

示例1: test_get_behaviour_unused_display_options

 public function test_get_behaviour_unused_display_options()
 {
     $this->assertEquals(array(), question_engine::get_behaviour_unused_display_options('interactive'));
     $this->assertEquals(array('correctness', 'marks', 'specificfeedback', 'generalfeedback', 'rightanswer'), question_engine::get_behaviour_unused_display_options('deferredfeedback'));
     $this->assertEquals(array('correctness', 'marks', 'specificfeedback', 'generalfeedback', 'rightanswer'), question_engine::get_behaviour_unused_display_options('deferredcbm'));
     $this->assertEquals(array('correctness', 'marks', 'specificfeedback', 'generalfeedback', 'rightanswer'), question_engine::get_behaviour_unused_display_options('manualgraded'));
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:7,代码来源:questionengine_test.php

示例2: is_compatible_behaviour

 /**
  * Given the quiz "How questions behave" setting, can the fault-tolerant mode work
  * with that behaviour?
  * @param string $behaviour the internal name (e.g. 'interactive') of an archetypal behaviour.
  * @return boolean whether fault-tolerant mode can be used.
  */
 public static function is_compatible_behaviour($behaviour)
 {
     $unusedoptions = question_engine::get_behaviour_unused_display_options($behaviour);
     // Sorry, double negative here. The heuristic is that:
     // The behaviour is compatible if we don't need to show specific feedback during the attempt.
     return in_array('specificfeedback', $unusedoptions);
 }
开发者ID:gurujiathome,项目名称:moodle-quizaccess_offlinemode,代码行数:13,代码来源:rule.php

示例3: definition


//.........这里部分代码省略.........
     $mform->addElement('header', 'interactionhdr', get_string('questionbehaviour', 'quiz'));
     // Shuffle within questions.
     $mform->addElement('selectyesno', 'shuffleanswers', get_string('shufflewithin', 'quiz'));
     $mform->addHelpButton('shuffleanswers', 'shufflewithin', 'quiz');
     $mform->setAdvanced('shuffleanswers', $quizconfig->shuffleanswers_adv);
     $mform->setDefault('shuffleanswers', $quizconfig->shuffleanswers);
     // How questions behave (question behaviour).
     if (!empty($this->current->preferredbehaviour)) {
         $currentbehaviour = $this->current->preferredbehaviour;
     } else {
         $currentbehaviour = '';
     }
     $behaviours = question_engine::get_behaviour_options($currentbehaviour);
     $mform->addElement('select', 'preferredbehaviour', get_string('howquestionsbehave', 'question'), $behaviours);
     $mform->addHelpButton('preferredbehaviour', 'howquestionsbehave', 'question');
     $mform->setDefault('preferredbehaviour', $quizconfig->preferredbehaviour);
     // Each attempt builds on last.
     $mform->addElement('selectyesno', 'attemptonlast', get_string('eachattemptbuildsonthelast', 'quiz'));
     $mform->addHelpButton('attemptonlast', 'eachattemptbuildsonthelast', 'quiz');
     $mform->setAdvanced('attemptonlast', $quizconfig->attemptonlast_adv);
     $mform->setDefault('attemptonlast', $quizconfig->attemptonlast);
     if ($this->get_max_attempts_for_any_override() < 2) {
         $mform->disabledIf('attemptonlast', 'attempts', 'eq', 1);
     }
     // -------------------------------------------------------------------------------
     $mform->addElement('header', 'reviewoptionshdr', get_string('reviewoptionsheading', 'quiz'));
     $mform->addHelpButton('reviewoptionshdr', 'reviewoptionsheading', 'quiz');
     // Review options.
     $this->add_review_options_group($mform, $quizconfig, 'during', mod_quiz_display_options::DURING, true);
     $this->add_review_options_group($mform, $quizconfig, 'immediately', mod_quiz_display_options::IMMEDIATELY_AFTER);
     $this->add_review_options_group($mform, $quizconfig, 'open', mod_quiz_display_options::LATER_WHILE_OPEN);
     $this->add_review_options_group($mform, $quizconfig, 'closed', mod_quiz_display_options::AFTER_CLOSE);
     foreach ($behaviours as $behaviour => $notused) {
         $unusedoptions = question_engine::get_behaviour_unused_display_options($behaviour);
         foreach ($unusedoptions as $unusedoption) {
             $mform->disabledIf($unusedoption . 'during', 'preferredbehaviour', 'eq', $behaviour);
         }
     }
     $mform->disabledIf('attemptduring', 'preferredbehaviour', 'neq', 'wontmatch');
     $mform->disabledIf('overallfeedbackduring', 'preferredbehaviour', 'neq', 'wontmatch');
     // -------------------------------------------------------------------------------
     $mform->addElement('header', 'display', get_string('display', 'form'));
     // Show user picture.
     $mform->addElement('select', 'showuserpicture', get_string('showuserpicture', 'quiz'), quiz_get_user_image_options());
     $mform->addHelpButton('showuserpicture', 'showuserpicture', 'quiz');
     $mform->setAdvanced('showuserpicture', $quizconfig->showuserpicture_adv);
     $mform->setDefault('showuserpicture', $quizconfig->showuserpicture);
     // Overall decimal points.
     $options = array();
     for ($i = 0; $i <= QUIZ_MAX_DECIMAL_OPTION; $i++) {
         $options[$i] = $i;
     }
     $mform->addElement('select', 'decimalpoints', get_string('decimalplaces', 'quiz'), $options);
     $mform->addHelpButton('decimalpoints', 'decimalplaces', 'quiz');
     $mform->setAdvanced('decimalpoints', $quizconfig->decimalpoints_adv);
     $mform->setDefault('decimalpoints', $quizconfig->decimalpoints);
     // Question decimal points.
     $options = array(-1 => get_string('sameasoverall', 'quiz'));
     for ($i = 0; $i <= QUIZ_MAX_Q_DECIMAL_OPTION; $i++) {
         $options[$i] = $i;
     }
     $mform->addElement('select', 'questiondecimalpoints', get_string('decimalplacesquestion', 'quiz'), $options);
     $mform->addHelpButton('questiondecimalpoints', 'decimalplacesquestion', 'quiz');
     $mform->setAdvanced('questiondecimalpoints', $quizconfig->questiondecimalpoints_adv);
     $mform->setDefault('questiondecimalpoints', $quizconfig->questiondecimalpoints);
     // Show blocks during quiz attempt.
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:67,代码来源:mod_form.php

示例4: definition


//.........这里部分代码省略.........
        } else {
            $currentbehaviour = '';
        }
        $behaviours = question_engine::get_behaviour_options($currentbehaviour);
        $mform->addElement('select', 'preferredbehaviour',
                get_string('howquestionsbehave', 'question'), $behaviours);
        $mform->addHelpButton('preferredbehaviour', 'howquestionsbehave', 'question');
        $mform->setDefault('preferredbehaviour', $quizconfig->preferredbehaviour);

        // Each attempt builds on last.
        $mform->addElement('selectyesno', 'attemptonlast',
                get_string('eachattemptbuildsonthelast', 'quiz'));
        $mform->addHelpButton('attemptonlast', 'eachattemptbuildsonthelast', 'quiz');
        $mform->setAdvanced('attemptonlast', $quizconfig->attemptonlast_adv);
        $mform->setDefault('attemptonlast', $quizconfig->attemptonlast);
        $mform->disabledIf('attemptonlast', 'attempts', 'eq', 1);

        //-------------------------------------------------------------------------------
        $mform->addElement('header', 'reviewoptionshdr',
                get_string('reviewoptionsheading', 'quiz'));
        $mform->addHelpButton('reviewoptionshdr', 'reviewoptionsheading', 'quiz');

        // Review options.
        $this->add_review_options_group($mform, $quizconfig, 'during',
                mod_quiz_display_options::DURING);
        $this->add_review_options_group($mform, $quizconfig, 'immediately',
                mod_quiz_display_options::IMMEDIATELY_AFTER);
        $this->add_review_options_group($mform, $quizconfig, 'open',
                mod_quiz_display_options::LATER_WHILE_OPEN);
        $this->add_review_options_group($mform, $quizconfig, 'closed',
                mod_quiz_display_options::AFTER_CLOSE);

        foreach ($behaviours as $behaviour => $notused) {
            $unusedoptions = question_engine::get_behaviour_unused_display_options($behaviour);
            foreach ($unusedoptions as $unusedoption) {
                $mform->disabledIf($unusedoption . 'during', 'preferredbehaviour',
                        'eq', $behaviour);
            }
        }
        $mform->disabledIf('attemptduring', 'preferredbehaviour',
                'neq', 'wontmatch');
        $mform->disabledIf('overallfeedbackduring', 'preferredbehaviour',
                'neq', 'wontmatch');

        //-------------------------------------------------------------------------------
        $mform->addElement('header', 'display', get_string('display', 'form'));

        // Show user picture.
        $mform->addElement('selectyesno', 'showuserpicture',
                get_string('showuserpicture', 'quiz'));
        $mform->addHelpButton('showuserpicture', 'showuserpicture', 'quiz');
        $mform->setAdvanced('showuserpicture', $quizconfig->showuserpicture_adv);
        $mform->setDefault('showuserpicture', $quizconfig->showuserpicture);

        // Overall decimal points.
        $options = array();
        for ($i = 0; $i <= QUIZ_MAX_DECIMAL_OPTION; $i++) {
            $options[$i] = $i;
        }
        $mform->addElement('select', 'decimalpoints', get_string('decimalplaces', 'quiz'),
                $options);
        $mform->addHelpButton('decimalpoints', 'decimalplaces', 'quiz');
        $mform->setAdvanced('decimalpoints', $quizconfig->decimalpoints_adv);
        $mform->setDefault('decimalpoints', $quizconfig->decimalpoints);

        // Question decimal points.
开发者ID:nigeldaley,项目名称:moodle,代码行数:67,代码来源:mod_form.php


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