learndash_ques_free_answer_correct

apply_filters( 'learndash_ques_free_answer_correct',  boolean $correct,  array $question_data,  array $user_response )

Filters whether the answer is correct or not for a free question type.


Description #


Parameters #

$correct

(boolean) Whether the answer is correct or not.

$question_data

(array) An array of question data.

$user_response

(array) An array of user response data.


Source #

File: includes/quiz/ld-quiz-pro.php


Examples #

 <?php
/**
 * Example usage for learndash_ques_free_answer_correct filter.
 */
add_filter(
	'learndash_ques_free_answer_correct',
	function( $correct, $question_data, $user_response ) {
		// May add any custom logic using $correct, $question_data, $user_response.

		// Always return $correct.
		return $correct;
	},
	10,
	3
);