本文整理汇总了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'));
}
示例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);
}
示例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.
示例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.