This repository contains a bash script for creating an H5P of multiple-choice questions (with a single correct answer; possibly with tips and right/wrong answer feedbacks) using the H5P Question Set template via the linux command line. Simply:
./mcq2h5p-FDBCK.sh control-fb.txt myMCQ-fb.txt
where myMCQ-fb.txt
(it may be named in some other way) is a plain-text input file that contains your multiple-choice questions and corresponding answers (possibly with tips and feedbacks) written in H5P Question Set template markup (see tutorial), e.g.,
1. Which of the following is a letter?
10:Is this in the alphabet?:Try again.:In letters, this is TEN.
9:Is this in the alphabet?:Not quite.:In letters, this is NINE.
*A:Is this in the alphabet?:Yes, A is a letter.:A is a letter.
2. Which of the following is a number?
*35
a
q
z
3. 15 + 1 + 3 = _____
16::15 + 1 = 16. Try something bigger.:This is short by 3.
21::15 + 3 + 3 = 21. Try something smaller.: The correct sum is 2 less than this.
*19:: Right!: 15 + 1 + 3 = 16 + 3 = 19.
11:: 15 - 4 = 11. A bit too small.: This is 8 smaller than the right sum.
(Note: Tips, correct- and wrong-answer feedbacks are given in item 1. Item 2 has neither tips nor right/wrong answer feedbacks. Item 3 has not tips but has right/wrong answer feedbacks.)
The H5P is created in the main directory and is called NAME_H5P_DIR.h5p
based on the value of H5P_NAME
in your control-fb.txt
file. There are a number of ways to view/play this newly created H5P:
- use Lumi, an offline H5P viewer and editor
- upload into a platform (e.g., h5p.org's H5P test drive page, Learning Management Systems (LMSs)); allows for further editing.
- view using h5p-view (a bash script that implements h5p-standalone to allow viewing/playing the H5P via the linux command line).
- use h5p-standalone directly (as in h5p-misc-math-001 or h5p-byBrowser).
To use:
- Clone this repository:
git clone https://github.com/justineuro/h5p-mcq-maker-fb.git
. - Prepare a plain text file, say
myMCQ-fb.txt
(it may be some other filename), containing your MC questions and answers written in H5P Question Set template markup (see the H5P Question Set Tutorial for additional information), and save it under theh5p-mcq-maker-fb
directory that you just cloned. - Edit the
control-fb.txt
file to set the parameters for your new H5P (includesNAME_H5P
,TITLE
,AUTHOR
,LICENSE
,INTRODUCTION
,PASS_PERCENTAGE
,DISABLE_BACKWARDS_NAVIGATION
,RANDOM_QUESTIONS
, andPOOL_SIZE
; seemcq2h5p-FDBCK.sh
for a description of these parameters). - At a linux command line within your
h5p-mcq-maker-fb
directory, issue the command:
./mcq2h5p-FDBCK.sh control-fb.txt myMCQ-fb.txt
where myMCQ-fb.txt
may be some other file containing your MC questions and answers (possibly with tips and/or right/wrong answer feedbacks). (Note: This file must end in two blank lines.)
The h5p.json
and content.json
files will be created in the appropriate locations inside the NAME_H5P_DIR
(based on the value of NAME_H5P
in the contro-fb.txt
) directory; the NAME_H5P_DIR
directory will be zipped-up to create your new H5P). Your newly created Question Set H5P, filename: NAME_H5P_DIR.h5p,
will be found in the h5p-mcq-maker
directory.
[... section omitted ...]
This folder includes (among others):
mcq2h5p-FDBCK.sh
- a bash script that converts to a Question Set H5P a plain text file containing mutiple-choice questions and answers .h5p-mcq-616_libs
- a folder that contains the libraries inside thequestion-set-616.h5p
re-use template that's available from the Examples & downloads section at https://h5p.org; theh5p.json
andcontent/content.json
files will be over-written to produce your new H5P. Among other libraries, this folder contains:H5P.QuestionSet-1.20
,H5P.MultiChoice-1.16
, andH5P.Question-1.5
. In addition, this folder also contains the library from theH5P.MathDisplay-1.0.7.h5p
(add support for math content rendering).control-fb.txt
- a plain text file containing the control parameters for your new H5P (e.g.,NAME_H5P
,TITLE
,AUTHOR
,LICENSE
,INTRODUCTION
,PASS_PERCENTAGE
,DISABLE_BACKWARDS_NAVIGATION
,RANDOM_QUESTIONS
, andPOOL_SIZE
; these are used for creating theh5p.json
andcontent.json
of your new H5P). You would want to edit this to suit your own specifications.myMCQ-fb.txt
- an example of 3 multiple-choice questions, 2 of which are selected each time the H5P is viewed/played. (Note that theMathJax
symbol "\
" has to be triply escaped. Thus,\(
should be written as\\\\(
and\sqrt{2}
should be written as\\\\sqrt{2}
.)myMCQ-fb.h5p
- the H5P created bymcq2h5p-FDBCK.sh
based on questions inmyMCQ-fb.txt
and using the values of control parameters incontrol-fb.txt
.
The repository also contains the files for two other examples.
- Files for
myMCQ-fb-1.h5p
:control-fb-1.txt
andmyMCQ-fb-1.txt
(5 questions); 3 randomly chosen questions are shown each time the H5P is played - Files for
myMCQ.h5p
:control.txt
andmyMCQ.txt
(10 questions w/o tips or feebbacks); 5 randomly chosen questions are shown each time the H5P is played
h5p-mcq-maker-fb by Justine Leon A. Uro is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/justineuro/h5p-mcq-maker-fb.