H5P for LearnDash Addon

Blanks, All correct

The purpose of this plugin is to ensure that all answers in H5P content are correct before allowing course progression in LearnDash.

(Requires a H5P for LearnDash License, must be LoggedIn to Download)


Here’s a high-level overview of how the plugin works:

  1. Checking Activation: When the plugin is activated, it first checks if the “H5P for LearnDash” plugin is active. If the required plugin is not active, an admin notice is displayed, and the current plugin is deactivated.
  2. Admin Notice: If the “H5P for LearnDash” plugin is not active, an admin notice is displayed to inform the administrator that the add-on requires the “H5P for LearnDash” plugin to be installed and active.
  3. Filtering Response Data: The plugin includes a filter that modifies the response data from H5P content. It checks if the content type is “Blanks” and performs specific checks and modifications on the response data.
  4. Enforcing Correctness: For “Blanks” content, the plugin ensures that the “Enable ‘Retry’” option is checked in the content settings. This allows users to correct their answers. It also checks if all answers are filled in (not empty). If any answer is empty, the user is not allowed to progress in the course.
  5. Success Status: If all answers are filled in and the user’s score is 100% (scaled score of 1), the plugin sets the “success” status of the response data to true. Otherwise, the “success” status is set to false.

In summary, this plugin adds a requirement for all answers to be correct in “Blanks” content created with the H5P plugin. It ensures that the “H5P for LearnDash” plugin is active, displays admin notices when necessary, and modifies the response data to enforce correctness and allow course progression in LearnDash only when all answers are correct.