Developers

Technical forum about Content Type or System Plugin development.
Here you can apply for developer access.

Adding .h5p activities programmatically to Drupal 8 nodes

Forums: 
I am using the H5P Drupal 8 module and am trying to inserting .h5p zip archives into newly created nodes through a script in a custom module.

I have tried to use the following code and am passing (to my knowledge) a complete $h5p_content array:

$H5PObj = H5PDrupal::getInstance();
$result = $H5PObj->insertContent($h5p_content, $contentMainId = NULL);

Am I missing something ? Do I need to call another function aside from insertContent()?

Verification Questions

Forums: 

I'm looking for a type of question interaction that will work inside Moodle where the admin can create questions, and the answers will have to be the same as the person profile.  For example, I would ask a series of questions in the profile "What is your mother's maiden name? / What street did you grow up on? / What is the color of your eyes? What is your favorite color?" the student would answer these questions during registration and then the admin would be able to place them through a Moodle course, or they would pop-up during the course.

Library Upload in WordPress

wiakc's picture
Forums: 

I've installed H5P plugin in my WordPress 5.3.2 under XAMPP on my local machine running macOS 10.15.3. Everything is working fine as is. The problem is when I try to upload a new library called greetingcard. I've created four files library.json, semantics.json, greetingcard.js, and greetingcard.css as per tutorial instructions. I've zip them individually (no directory) into greetingcard.zip using a native macOS compression tool. Then I've renamed the file to greetingcard.h5p and tried to upload the file to the library.

Pages