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

		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.