Browse: Home / Functions /

learndash_add_new_essay_response

learndash_add_new_essay_response( string $response,  WpProQuiz_Model_Question $this_question,  WpProQuiz_Model_Quiz $quiz,  array|null $post_data = null )

Adds a new essay response.


Description #

Called from LD_QuizPro::checkAnswers() via AJAX.


Parameters #

$response

(string) (Required) Essay response.

$this_question

(WpProQuiz_Model_Question) (Required) Pro quiz question object.

$quiz

(WpProQuiz_Model_Quiz) (Required) Pro Quiz object.

$post_data

(array|null) (Optional) Quiz information and answers.

Default value: null


Return #

(boolean|int|WP_Error) Returns essay ID or WP_Error if the essay could not be created.


Source #

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


Changelog #

Changelog
Version Description
4.10.3 Essays have a learndash_version meta field to help distinguish between old and new Essays.
2.2.0 Introduced.