justineuro / h5p-mcq-maker

A bash script for converting a plain-text file of multiple-choice questions to H5P

Home Page:https://justineuro.github.io/h5p-mcq-maker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

h5p-mcq-maker

This repository contains a bash script for creating an H5P of multiple-choice questions (with a single correct answer) using the H5P Question Set template via the linux command line. Simply:

./mcq2h5p.sh myMCQuestions.txt

where myMCQuestions.txt (it may be named in some other way) is a plain text input file that contains your multiple-choice questions and corresponding answers written in H5P Question Set template markup, e.g.,

1. Which of the following is a letter?
10
9
*A

2. Which of the following is a number?
*35
a
q
z

3. 15 + 1 + 3 = _____
16
21
*19
11

(Note: Tips, correct- and wrong-answer feedback have not been implemented. One cannot use them for now.)
The H5P is created in the main directory and is called myNewH5P-mcq.h5p. There are a number of ways to view/play this newly created H5P:

  • use Lumi, an offline H5P viewer and editor (Note: If you have only one such H5P to create, then cutting and pasting your questions text into Lumi is probably the easiest way to create the H5P. This bash script becomes useful if you have many (a substantial amount) of question sets for which you want to create H5Ps.)
  • 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).

Instructions on use

To use:

  • Clone this repository: git clone https://github.com/justineuro/h5p-mcq-maker.git.
  • Prepare a plain text file, say myMCQuestions.txt (it may be some other filename), containing your MC questions and answers written in H5P Question Set template markup, and save it under the h5p-mcq-maker directory that you just cloned.
  • Edit the control.txt file to set the parameters for your new H5P (includes TITLE, AUTHOR, LICENSE, INTRODUCTION, PASS_PERCENTAGE, DISABLE_BACKWARDS_NAVIGATION, RANDOM_QUESTIONS, POOL_SIZE, and N_QUESTIONS; see mcq2h5p.sh for a description of these parameters).
  • At a linux command line within your h5p-mcq-maker directory, issue the command:
./mcq2h5p.sh myMCQuestions.txt

where myMCQuestions.txt may be some other file containing your MC questions and answers. (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 myNewH5P-mcq directory (this will be zipped-up to create your new H5P). Your newly created Question Set H5P, filename: myNewH5P-mcq.h5p, will be found in the h5p-mcq-maker directory.

[... section omitted ...]

Contents of this repositoty

This folder includes (among others):

  • mcq2h5p.sh - a bash script that converts a plain text file containing mutiple-choice questions and answers to a Question Set H5P.
  • myNewH5P-mcq - a folder that contains the libraries inside the question-set-616.h5p re-use template that's available from the Examples & downloads section at https://h5p.org; the h5p.json and content/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, and H5P.Question-1.5.
  • control.txt - a plain text file containing the control parameters for your new H5P (e.g., TITLE, AUTHOR, LICENSE, INTRODUCTION, PASS_PERCENTAGE, DISABLE_BACKWARDS_NAVIGATION, RANDOM_QUESTIONS, POOL_SIZE, and N_QUESTIONS; these are used for creating the h5p.json and content.json of your new H5P). You would want to edit this to suit your own specifications.
  • myMCQuestions.txt - an example of 10 multiple-choice questions, five (5) of which are selected each time the H5P is viewed/played. (Note that the MathJax symbol "\" has to be triply escaped. Thus, \( should be written as \\\\( and \sqrt{2} should be written as \\\\sqrt{2}.)
  • myNewH5P-mcq.h5p - the H5P created by mcq2h5p.sh from myMCQuestions.txt.

Creative Commons License
h5p-mcq-maker 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.

About

A bash script for converting a plain-text file of multiple-choice questions to H5P

https://justineuro.github.io/h5p-mcq-maker/

License:Other


Languages

Language:JavaScript 86.7%Language:CSS 12.1%Language:Shell 1.2%