public function process_save(question_attempt_pending_step $pendingstep) {
        if ($this->qa->get_state()->is_finished()) {
            return question_attempt::DISCARD;
        } else if (!$this->qa->get_state()->is_active()) {
            throw new coding_exception('Question is not active, cannot process_actions.');
        }

        if ($this->is_same_response($pendingstep)) {
            return question_attempt::DISCARD;
        }

        if ($this->is_complete_response($pendingstep)) {
            $pendingstep->set_state(question_state::$complete);
        } else {
            $pendingstep->set_state(question_state::$todo);
        }
        return question_attempt::KEEP;
    }
public function process_save(question_attempt_pending_step $pendingstep) {
        if ($this->qa->get_state()->is_finished()) {
            return question_attempt::DISCARD;
        } else if (!$this->qa->get_state()->is_active()) {
            throw new coding_exception('Question is not active, cannot process_actions.');
        }

        if ($this->is_same_response($pendingstep)) {
            return question_attempt::DISCARD;
        }

        if ($this->is_complete_response($pendingstep)) {
            $pendingstep->set_state(question_state::$complete);
        } else {
            $pendingstep->set_state(question_state::$todo);
        }
        return question_attempt::KEEP;
    }
public function process_save ( question_attempt_pending_step $ pendingstep ) { if ( $ this -> qa -> get_state ( ) -> is_finished ( ) ) { return question_attempt :: DISCARD ; } else if ( ! $ this -> qa -> get_state ( ) -> is_active ( ) ) { throw new coding_exception ( 'Question is not active, cannot process_actions.' ) ; } if ( $ this -> is_same_response ( $ pendingstep ) ) { return question_attempt :: DISCARD ; } if ( $ this -> is_complete_response ( $ pendingstep ) ) { $ pendingstep -> set_state ( question_state :: $ complete ) ; } else { $ pendingstep -> set_state ( question_state :: $ todo ) ; } return question_attempt :: KEEP ; }
Implementation of processing a save action that should be suitable for
most subclasses.
@param question_attempt_pending_step $pendingstep a partially initialised step
containing all the information about the action that is being peformed.
@return bool either {@link question_attempt::KEEP} or {@link question_attempt::DISCARD}
Implementation of processing a save action that should be suitable for most subclasses .