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.
Return Return
(int)
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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.2.0 | Use strict type comparison. |
3.9.2 | |
3.16.0 | Introduced. |