public function adjust_display_options(question_display_options $options) { parent::adjust_display_options($options); if (!$this->qa->get_state()->is_finished() && $this->qa->get_last_behaviour_var('_try')) { $options->feedback = true; } }
public function adjust_display_options(question_display_options $options) { parent::adjust_display_options($options); if ($this->qa->get_state()->is_finished()) { // Hide all feedback except genfeedback and manualcomment. $save = clone $options; $options->hide_all_feedback(); $options->generalfeedback = $save->generalfeedback; $options->manualcomment = $save->manualcomment; } }
public function adjust_display_options(question_display_options $options) { // Save some bits so we can put them back later. $save = clone $options; // Do the default thing. parent::adjust_display_options($options); // Then, if they have just Checked an answer, show them the applicable bits of feedback. if (!$this->qa->get_state()->is_finished() && $this->qa->get_last_behaviour_var('_try')) { $options->feedback = $save->feedback; $options->correctness = $save->correctness; $options->numpartscorrect = $save->numpartscorrect; } }
public function adjust_display_options(question_display_options $options) { // We only need different behaviour in try again states. if (!$this->is_try_again_state()) { parent::adjust_display_options($options); return; } // Let the hint adjust the options. $hint = $this->get_applicable_hint(); if (!is_null($hint)) { $hint->adjust_display_options($options); } // Now call the base class method, but protect some fields from being overwritten. $save = clone $options; parent::adjust_display_options($options); $options->feedback = $save->feedback; $options->numpartscorrect = $save->numpartscorrect; // In a try-again state, everything except the try again button // Should be read-only. This is a mild hack to achieve this. if (!$options->readonly) { $options->readonly = self::READONLY_EXCEPT_TRY_AGAIN; } }