LLMS_Quiz_Legacy::previous_question( $question_id )
Previous question button click Finds the previous question and redirects the user to the post
Description Description
Return Return
(void)
Source Source
File: includes/class.llms.quiz.legacy.php
public static function previous_question( $question_id ) { $quiz = LLMS()->session->get( 'llms_quiz' ); foreach ( (array) $quiz->questions as $key => $value ) { if ( $value['id'] == $question_id ) { $previous_question_key = ( $key - 1 ); if ( $previous_question_key >= 0 ) { $prev_question_link = get_permalink( $quiz->questions[ $previous_question_key ]['id'] ); $redirect = get_permalink( $prev_question_link ); return $quiz->questions[ $previous_question_key ]['id']; } } } }
Expand full source code Collapse full source code View on GitHub
User Contributed Notes User Contributed Notes
Permalink: