Automatic Creation of H5P
H5P Quiz Content Type
The Quiz H5P Content type lets you specify a quiz in Respondus text format in the Textual editor. While it still involves a copy/paste operation, quizzes can be generated in ChatGPT using the H5P QuizCraft GPT and then pasted into the H5P Quiz Textual editor. The required format is as follows.
H5P Quiz Textual Editor Instructions
Use an empty line to separate each question. In multi-choice, the first line is the question, and the next lines are the answer alternatives. The correct alternatives are prefixed with an asterisk(*); tips and feedback can also be added: *alternative:tip: feedback if chosen: feedback if not chosen. Example:
What number is PI?
*3.14
9.82
What is 4 * 0?
1
4
*0
Sample ChatGPT Prompt – Quiz Generation
Here’s a sample prompt you can use in ChatGPT to generate the quiz input text to be used in the H5P Quiz content type:
Generate 10 multiple-choice questions that will test students on their comprehension of the textbook content following this paragraph. Each question must have a minimum of 3 possible answers and a maximum of 4 possible answers. Each question should be stated on its own line, followed by each answer on its own line, with the correct answer denoted by an asterisk ("*") preceding the answer wording. The last answer in each question set should be followed by a blank line before the next question, and there should be no blank line between each question and its corresponding set of answers. Do NOT label the answers with letters or numbers or use any text decoration other than the asterisk ("*") that indicates the correct answer. The format must be exactly as specified, because it will be used by another computer program that requires this specific format. Example of correct output format for two questions:
What number is PI?
*3.14
9.82
What is 4 * 0?
1
4
*0
Here's the textbook content:
[PASTE TEXTBOOK CONTENT HERE]
Editing Source Files and Re-uploading .h5p Files
H5P files are .zip archives. When you download a .h5p source file, you can rename it to .zip or use a tool like 7-Zip to extract its contents into a folder.
H5P File Structure
Most H5P files contain library folders, the main h5p.json file and a content folder; the content folder is where the activity data is stored in JSON. This JSON file defines the structure, settings, and content of the H5P activity.
📂 MyActivity.h5p
┣ 📂 content
┃ ┗ 📄 content.json
┣ 📂 H5P.InteractiveVideo
┗ 📂 H5P.QuestionSet
┗ 📄 h5p.json
Use a Reference File
- Download an existing activity of the same type with fully implemented questions to understand the required data format.
- H5P requires precise formatting for its data. Any deviation from its expected structure will cause validation errors and prevent re-uploading to the H5P Hub.
Using the H5P Zipper Tool
- Use the H5P Zipper Tool to generate a valid .h5p file from your source files before reuploading it to the H5P Hub.
- Copy and paste the folder path of the extracted H5P folder, and the tool will create an H5P file ready to be reuploaded
Dialogue Card Creation
- Create a new Dialogue Card H5P. Create one card in the new H5P.
- Once created, you will see a screen with the H5P. Click the Reuse button and download as a .h5p file
- Extract the .h5p with the built-in ZIP program, 7-Zip, or WinZip.
- The folder structure should be similar to:
- In the content folder, you will find the content.json file:
- You can open this file with a text editor like Notepad, Notepad++ or VS Code.
- The main content is the dialogue Array in the file; adding one example question before saving the .h5p file will give you the proper formatting.
- Copy the dialogue array from the JSON with the example question formatted and use it as a prompt to an AI assistant like Chat GPT or Gemini
“Using this formatting :
 “dialogs”: [  {   “text”: “<p style=\”text-align:center;\”>Biological macromolecules</p>”,   “answer”: “<p style=\”text-align:center;\”>Large, complex molecules essential to life</p>”,   “tips”: {}  }} Can you complete the dialogs array with these terms keeping the exact wording: *pass the terms/answers here in format: [key term: answer]* -  Replace the dialogs array with the new content and save the file.
- Use the latest release of the H5P Zipper Tool, open the tool and press 1 and enter on your keyboard.
- Paste the folder path of the extracted H5P folder with the updated content file into the tool and hit enter.
- You should get a success message and a new .h5p file with the same name as the folder in the source folder.
- Â Upload this newly created.h5p file to the hub and check for errors. Sometimes, AI will change wording or miss a question.
H5P Other Content Type
You can modify the H5P zip file containing the text to other content types to automatically load content. For instance, see the example below for the Flashcard content type.