Browse: Home / Hooks /

learndash_ques_free_answer_correct

apply_filters( 'learndash_ques_free_answer_correct',  boolean $correct,  array $question_data,  string $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

(string) User response data.


Source #

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


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

 <?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
);