LLMS_Quiz_Attempt::delete()

Delete the object from the database


Description Description

Overrides the parent method to perform other actions before deletion.


Top ↑

Return Return

(bool) true on success, false otherwise.


Top ↑

Source Source

File: includes/models/model.llms.quiz.attempt.php

788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
    return $this->set( 'questions', serialize( $questions ), $save );
}
 
/**
 * Set the status of the attempt
 *
 * @since 3.16.0
 * @since 4.0.0 Use strict comparisons.
 *
 * @param string  $status Status value.
 * @param boolean $save   If `true`, immediately persists to database.
 * @return false|LLMS_Quiz_Attempt
 */
public function set_status( $status, $save = false ) {
 
    $statuses = array_keys( llms_get_quiz_attempt_statuses() );
    if ( ! in_array( $status, $statuses, true ) ) {
        return false;
    }
    return $this->set( 'status', $status );
 
}
 
/**
 * Record the attempt as started
 *
 * @since 3.9.0
 *
 * @return LLMS_Quiz_Attempt Instance of the current quiz attempt object.
 */
public function start() {
 
    $this->set( 'start_date', current_time( 'mysql' ) );
    $this->save();
    return $this;
 
}
 
/**
 * Retrieve the private data array
 *
 * @since 3.9.0
 *
 * @return array
 */
public function to_array() {


Top ↑

Changelog Changelog

Changelog
Version Description
4.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.