public function process_finish(question_attempt_pending_step $pendingstep) { $keep = parent::process_finish($pendingstep); $fraction = $pendingstep->get_fraction(); if ($keep == question_attempt::KEEP && $fraction != null && $fraction != 1) { $pendingstep->set_fraction(0); $pendingstep->set_state(question_state::$gradedwrong); } return $keep; }
public function process_finish(question_attempt_pending_step $pendingstep) { $status = parent::process_finish($pendingstep); if ($status == question_attempt::KEEP) { $fraction = $pendingstep->get_fraction(); if ($this->qa->get_last_step()->has_behaviour_var('certainty')) { $certainty = $this->qa->get_last_step()->get_behaviour_var('certainty'); } else { $certainty = question_cbm::default_certainty(); $pendingstep->set_behaviour_var('_assumedcertainty', $certainty); } if (!is_null($fraction)) { $pendingstep->set_behaviour_var('_rawfraction', $fraction); $pendingstep->set_fraction(question_cbm::adjust_fraction($fraction, $certainty)); } $pendingstep->set_new_response_summary( question_cbm::summary_with_certainty($pendingstep->get_new_response_summary(), $this->qa->get_last_step()->get_behaviour_var('certainty'))); } return $status; }