本文整理汇总了PHP中question_attempt_step::has_behaviour_var方法的典型用法代码示例。如果您正苦于以下问题:PHP question_attempt_step::has_behaviour_var方法的具体用法?PHP question_attempt_step::has_behaviour_var怎么用?PHP question_attempt_step::has_behaviour_var使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_attempt_step
的用法示例。
在下文中一共展示了question_attempt_step::has_behaviour_var方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_has_var
public function test_has_var() {
$step = new question_attempt_step(array('x' => 1, '-y' => 'frog'));
$this->assertTrue($step->has_qt_var('x'));
$this->assertTrue($step->has_behaviour_var('y'));
$this->assertFalse($step->has_qt_var('y'));
$this->assertFalse($step->has_behaviour_var('x'));
}
示例2: summarise_action
public function summarise_action(question_attempt_step $step) {
if ($step->has_behaviour_var('comment')) {
return $this->summarise_manual_comment($step);
} else if ($step->has_behaviour_var('finish')) {
return $this->summarise_finish($step);
} else {
return $this->summarise_save($step);
}
}
示例3: summarise_action
public function summarise_action(question_attempt_step $step)
{
if ($step->has_behaviour_var('comment')) {
return $this->summarise_manual_comment($step);
} else {
if ($step->has_behaviour_var('finish')) {
return $this->summarise_finish($step);
} else {
if ($step->has_behaviour_var('seen')) {
return get_string('seen', 'qbehaviour_informationitem');
}
}
}
return $this->summarise_start($step);
}
示例4: apply_attempt_state
public function apply_attempt_state(question_attempt_step $step)
{
if ($step->has_behaviour_var('_applypenalties')) {
$this->applypenalties = (bool) $step->get_behaviour_var('_applypenalties');
}
parent::apply_attempt_state($step);
}
示例5: summarise_action
public function summarise_action(question_attempt_step $step)
{
if ($step->has_behaviour_var('comment')) {
return $this->summarise_manual_comment($step);
} else {
if ($step->has_behaviour_var('finish')) {
return $this->summarise_finish($step);
} else {
if ($step->has_behaviour_var('tryagain')) {
return get_string('tryagain', 'qbehaviour_interactive');
} else {
if ($step->has_behaviour_var('submit')) {
return $this->summarise_submit($step);
} else {
return $this->summarise_save($step);
}
}
}
}
}
示例6: do_grading
protected function do_grading(question_attempt_step $responsesstep,
question_attempt_pending_step $pendingstep) {
if (!$this->question->is_gradable_response($responsesstep->get_qt_data())) {
$pendingstep->set_state(question_state::$gaveup);
} else {
$response = $responsesstep->get_qt_data();
list($fraction, $state) = $this->question->grade_response($response);
if ($responsesstep->has_behaviour_var('certainty')) {
$certainty = $responsesstep->get_behaviour_var('certainty');
} else {
$certainty = question_cbm::default_certainty();
$pendingstep->set_behaviour_var('_assumedcertainty', $certainty);
}
$pendingstep->set_behaviour_var('_rawfraction', $fraction);
$pendingstep->set_fraction(question_cbm::adjust_fraction($fraction, $certainty));
$pendingstep->set_state($state);
$pendingstep->set_new_response_summary(question_cbm::summary_with_certainty(
$this->question->summarise_response($response),
$responsesstep->get_behaviour_var('certainty')));
}
return question_attempt::KEEP;
}
示例7: summarise_action
public function summarise_action(question_attempt_step $step)
{
if ($step->has_behaviour_var('helpme')) {
return $this->summarise_helpme($step);
} else {
return parent::summarise_action($step);
}
}
示例8: summarise_action
public function summarise_action(question_attempt_step $step)
{
// Summarise hint action.
foreach ($this->question->hints_available_for_student($step->get_qt_data()) as $hintkey) {
$hintkey = $this->adjust_hintkey($hintkey);
if ($step->has_behaviour_var($hintkey . 'btn')) {
return $this->summarise_hint($step, $hintkey);
}
}
return parent::summarise_action($step);
}