LLMS_Quiz_Attempt::get_question_order( int $question_id )

Get the numeric order of a question in a given quiz


Parameters Parameters

$question_id

(int) (Required) WP Post ID of the LLMS_Question.


Top ↑

Return Return

(int)


Top ↑

Source Source

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

	public function get_question_order( $question_id ) {

		foreach ( $this->get_questions() as $order => $data ) {

			if ( absint( $data['id'] ) === $question_id ) {
				return $order + 1;
			}
		}

		return 0;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.2.0 Use strict type comparison.
3.9.2
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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