Formulas question type

Question types ::: qtype_formulas
Maintained by Picture of Dominique BauerDominique Bauer
This is a question type plugin for Moodle with random values and multiple answer fields.
Latest release:
1456 sites
55 fans
Current versions available: 2

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.


Screenshot #0
Screenshot #1


Picture of Dominique Bauer
Dominique Bauer (Lead maintainer)
Jean-Michel Védrine: Former maintainer
hon wai lau: Original creator
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Sun, Jan 31, 2021, 10:53 PM
    I would like to make a small suggestion for a future version: It would be nice to select scientific notation for the correct result, which is shown as feedback.
  • 2018-2019
    Mon, Mar 8, 2021, 12:12 PM
    I was trying to look up how to resize the answer box on the site and the login appears to be stuck in a loop. Could you please check this. Thanks!
  • Mon, Mar 8, 2021, 5:05 PM
    Hi guys,

    first of all: This qType is amazing! I came across this qtype just recently and I am currently migrating all of my static questions to the formula type.

    However, I just experienced an issue while trying to regarde a quiz. After the quiz was taken by the students I realized that I was to strict in terms of rounding tolerance. So I modified the "relative error" setting in the question and performed a regrading. However, the regarding shows no effect on the automatic grading nor the display of the "correct answer" (also adjusted). Do I have to reset or change any other setting to impact the marking in the regrading process?

  • Wed, Mar 10, 2021, 2:26 PM
    It seems that when the answer is a number answer, any text (non numeric for exemple) should show an alert. It's usefull for the comma decimal alert for french people...
    But it seems that it doesn't work anymore.
    - Tested on your site (and mine) :
    - Tested on Firefox and Chrome
    When in the answer box you write something else than number, no alert shown and aswer considered as wrong.
    Did I misunderstood ?
  • Sun, Apr 18, 2021, 1:44 AM
    At school we use formula question type in our moodle 3.4 version. Just a couple of weeks ago we have gone up to moodle 3.9 and i am finding and issue that i cannot find how to solve. Before, when the student wanted to answer a question if the format he was using wasn't correct, a little red triangle would appear right at the end of the answering box and that was very useful. Example: student trying to use comma instead of dot for decimals, using "o" instead of "0", forgetting to write the units, etc. Well, all this doesn't seem to work at moodle 3.9 version. ¿Could you kindly help me? Really thankful.
  • Sun, Apr 18, 2021, 1:58 AM
    Hi again.
    Just saw that what i have found reported is also been reported as a bug but it is still no resolved.
    See in bugs tracker: Plugins CONTRIB-8421, QT_Formulas: Input Validation
    Hope you can fix it soon.
  • Sun, May 9, 2021, 5:04 PM

    Would you mind having a look at my PR #26 on GitHub? It adds functions for statistics (normal distribution cdf) and number theory (modular exponentiation and modular inverse) and would make the plugin even more useful for quizzes in statistics or cryptography classes.

  • Fri, Jul 23, 2021, 10:22 PM
    For those of you who have the input validation working, I do this to deal with users having a comma as decimal separator: let javascript replace the commas with points.
    Edit the file: [root to moodle]/question/type/formulas/script/formatcheck.js and add one line to the onkeyup event:

    input.onkeyup = function() {
    this.value = this.value.replace(',','.'); // <<<------ THIS LINE ADDED
    this.formulas.common.fn.update(this.formulas.common, this.formulas.self);

  • Thu, Aug 5, 2021, 12:13 AM
    I need comma as decimal separator, but I get warning that should be a point. Is it possible to solve it? Would be thankful for your help.
  • Thu, Aug 5, 2021, 12:33 AM
    Sasha, there is a different approach in this discussion:

    You will find a question submitted by Dominique with some javascript code you can copy and paste into your questions.
  • Thu, Aug 5, 2021, 2:15 PM
    Thank you Edgardo for the quick reply! Unfortunately, I'm not programmer and didn't understand that messaging very well. I would be grateful if you can point me directly where is Dominique script and how I can correct comma problem.
  • Thu, Aug 5, 2021, 11:15 PM
    Check this section in

    There is a .txt file called "JavaScript code for decimal comma.txt". When you create a new Formulas Question in your question bank, you have to include that javascript code in the text part of the question.
    Before copying and pasting that code, you have to enter the "Edit HTML" mode (in your question editor it could be a button showing "html" or "<>"). Just add the code included in the .txt file at the bottom of the html code of the question.
    In that same section you will find an example question "Decimal Comma". You could import this question and use it as reference. Edit it, enter the html mode, and you will find the javascript code included in that question.
  • Fri, Aug 6, 2021, 4:28 PM
    Edgardo thank you again! Everything works! smile
  • Sun, Sep 19, 2021, 1:11 AM
    We are planning to upgrade our Moodle to version 3.11. Is the current version of the Formulas Question Type plugin compatible with the latest version of Moodle?
  • Sun, Sep 19, 2021, 4:41 PM
    I have the same question as Mostafizur, thanks
1 2 3
Please login to post comments