LLMS_Question::get_question( string $format = 'html', LLMS_Quiz_Attempt $attempt = null )

Get the question text (title).


Parameters Parameters

$format

(string) (Optional) Format of the question text. Accepts 'html' or 'plain'.

Default value: 'html'

$attempt

(LLMS_Quiz_Attempt) (Optional) Quiz Attempt object.

Default value: null


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/models/model.llms.question.php

	public function get_question( $format = 'html', $attempt = null ) {
		/**
		 * Filter the question text.
		 *
		 * The dynamic portion of this filter, `{$type}`, refers to the question type.
		 *
		 * @since 7.8.0
		 *
		 * @param string            $title    Question title.
		 * @param string            $format   Format of the question text. Accepts 'html' or 'plain'.
		 * @param LLMS_Question     $question Question object.
		 * @param LLMS_Quiz_Attempt $attempt  Attempt object.
		 */
		return apply_filters( "llms_{$this->get( 'question_type' )}_question_get_question", $this->get( 'title' ), $format, $this, $attempt );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.8.0 Added $attempt param.
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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