formulas question type for Moodle
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
backup Fix answernumbering bugs Aug 3, 2018
db Fix answernumbering bugs Aug 3, 2018
lang/en Implement privacy provider May 9, 2018
pix Fix use of formatcheck on edit page Jan 31, 2018
samples Add some sample questions Nov 10, 2014
script Fix use of formatcheck on edit page Jan 31, 2018
tests Fix bug in sigfig function Oct 13, 2018
.travis.yml Small fix to README May 9, 2018
conversion_rules.php More spacing fixes Jun 9, 2018
edit_formulas_form.php Fix tests for answernumbering Jun 4, 2018
instantiate.php Spacing problem in one test Jan 29, 2018
phpunit.xml Bump version before release May 18, 2018
question.php missing arg in check_combined_feedback_file_access Jul 18, 2018
renderer.php Fix answernumbering bugs Aug 3, 2018
settings.php Add fact, comb, perm, gcd and lcm functions Apr 25, 2014
styles.css Multichoice answer numbering Jun 4, 2018

Formulas question type for Moodle

This is a question type plugin for Moodle with random values and multiple answer fields.

The answer fields can be placed anywhere in the question so that we can create questions involving various answer structures such as coordinate, polynomial and matrix.

Other features such as unit checking and multiple subquestions are also available.

These functionalities can simplify the creation of questions in many fields related to mathematics, numbers and units, such as physics and engineering.

This question type was written by Hon Wai Lau and versions for Moodle 1.9 and 2.0 are still available at the original author's website at the date of this writting

This question type was upgraded to the new question engine introduced in Moodle 2.1 by Jean-Michel Vedrine

This version is compatible with Moodle 3.0 and ulterior versions. It has been tested with Moodle versions up to 3.4 and 3.5dev. It has also een tested with PHP versions 7.0, 7.1 and 7.2. If you are running an older version of Moodle another version of the formulas question type is available for Moodle versions 2.6 to 2.9.


You will need to install Tim Hunt's Adaptive question behaviour for multi-part questions (qbehaviour_adaptivemultipart) prior to installing the formulas question type.

You can get it from the Moodle plugin directory or from Github

You absolutely need version 3.3 or newer of this behaviour, the formulas question type will not work with previous versions.


Installation from the Moodle plugin directory (prefered method)

This question type is available from

Install as any other Moodle question type plugin

Installation Using Git

To install using git type these commands in the root of your Moodle install: git clone git:// question/type/formulas echo '/question/type/formulas/' >> .git/info/exclude

Installation From Downloaded zip file

Alternatively, download the zip from

unzip it into the question/type folder, and then rename the new folder to formulas.

Creating formulas questions

This question type is very powerful and permit creation of a wide range of questions.

But mastering all the possibilities require some practice and there is a learning curve on creating formulas questions.

Here are some pointers to the available help :

Reporting bugs, problems

You can see the list of issues here:

To create a new tracker issue, Log in and click on "Create" in the menu bar. Choose "Plugins (CONTRIB" in the "Project" field and "Question type: formulas" in the "Component(s)" field. Try to include as much details as you can so that the problem can be reproduced.