Question types: Formulas question type

Maintained by Picture of Jean-Michel VédrineJean-Michel Védrine
This is a question type plugin for Moodle with random values and multiple answer fields.
609 sites
32 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 Jean-Michel Védrine
Jean-Michel Védrine (Lead maintainer)
Picture of hon wai lau
hon wai lau: Original creator
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Jean-Michel Védrine
    Tue, Nov 11, 2014, 12:40 AM
    As part of my 60th birthday celebration I am (finally !) releasing a public version of the formulas question type that have been available for years on my Github repository.
    It is quite difficult to rapidly get a grasp on this question type because creating new question require some experience, but you can get a first grasp of the possibilities by importing the samples/sample-formulas-questions.xml file in your question bank. Alos this plugin require version 3.3 of qbehaviour_adaptivemultipart but I don't know if I should mention that somewhere in the description. Last thing, can you create a component in the CONTRIB tracker for this plugin. Thanks.
  • Picture of David Mudrák
    Wed, Dec 3, 2014, 7:46 PM
    Hi Jean-Michel. Thanks for sharing yet another excellent piece of work. I was able to successfully test the functionality of some
    samples provided. Some notes collected during the code review:

    Documentation on creating formulas question would really help. Hopefully it's something you can ask the users community to help
    with. In the styles.css file, some CSS selectors might be defined more strictly to make sure they apply to the given question type
    only. See core question types for some good examples of it (typically using appropriate .que prefix etc).

    The variables.php defines some functions in the global PHP scope. It is generally considered as a bad practise due to eventual
    collisions. You may wish to encapsulate those as static methods of some correctly prefixed/named class.

    I am happy to see both moodle1 and moodle2 backup formats supported, as well as included unit tests. I am sure this question type
    will soon find a solid user base. Good luck with maintaining it, and thanks for your patience with the review and approval process.
    You are cleared to land now, welcome to the Plugins directory!
  • Germán and Temudgin
    Mon, Dec 8, 2014, 10:11 AM
    Hi Jean Michel,

    Documentation page started at . Please feel free to add or correct as needed.
  • Picture of Bernat Martinez
    Mon, Oct 19, 2015, 2:20 AM
    Hi Jean Michel,

    It has been reported that there are some problems in the answer fields length, we have made some changes at css file and it seems to display correcty.
    After making the changes you will need to clear caches at
    Site administration>Development> Purge all caches
  • Picture of wolfram roemhild
    Tue, Nov 29, 2016, 8:25 PM
    Hi Jean Michel,

    Thank you for this great question type.

    One question that I could not solve: Is it possible to use the random variable system inside \TeX notation?

    Random variables: A = {2,3,4,5}; B = {2,3,5}
    Question Text: Simplify that radical: \( \sqrt{ {=A*A*B} } \)

    Obviouly, \TeX is overriding the variable system function. Is there any way to have the calculation been done first?

    Best, Wolfram
  • Picture of Jean-Michel Védrine
    Tue, Nov 29, 2016, 8:54 PM
    I am now retired and I don't even have a Moodle website with the formula question type installed, but what you says is very surprising to me because I have done tons of formulas questions with TeX formulas involving formulas variables with no problem because the calculations are done on the server before the webpage is served to the client and TeX rendering is done on the client side (I was using MathJax which is standard in latest Moodle versions) so I think the calculation is always done before TeX rendering
    And even if you are not using the MathJax filter (for instance if you are using a filter where teX formulas are replaced by images) I think that unless Moodle code has changed a lot since I left Moodle development, any TeX filter will always modify the page content after the formulas questions has done all the calculations. So I am puzzled by your report.
  • Picture of Jean-Michel Védrine
    Tue, Nov 29, 2016, 8:56 PM
    If I can find some time I will install the latest Moodle release and install the formulas question type to see if I can reproduce the problem. It will remember me of "the good old time" when I was a teacher wink
  • Picture of Miro Iliaš
    Mon, Apr 3, 2017, 4:08 PM
    Dear Jean-Michel, I would be very glad if you would extended your plugin for the most recent Moodle.
  • Picture of Jean-Michel Védrine
    Tue, Apr 4, 2017, 7:39 PM
    Hello Miro,
    As I said in a previous message I am now retired. When I retired about a year ago, I was expecting that even if I don't use Moodle anymore I would be able to continue to maintain this plugin, but unfortunately it's a too big job to stay in touch with all Moodle evolutions. I am sad to report that most probably there will be no new version from me and I will put this plugin in the "seeking for adoption" list.
  • Picture of hon wai lau
    Sun, Apr 9, 2017, 10:52 AM
    Hello Miro,

    I agree with Jean-Michel that this plugin may need a new maintainer. When I leave my previous job, I am glad that he was able to take the maintenance, for more than five years. I have found that it is quite tough to maintain it while I am not using it myself.

    The question engine evolves slowly so constant communication with the official team may be required to change the related codes. For a new version, re-running on many existing questions (that I don't have now) is needed to make sure things work. It may not be a lot of work, but continuous participation is needed. A good candidate may be a user with programming background like what Jean-Michel did. I might be able to provide some supports for the things not related to the interface with Moodle question engine.
  • Picture of hon wai lau
    Sun, Apr 9, 2017, 11:02 AM
    I should also mention that my old documentation have been ported here recently, thanks to Dominique Bauer

    I am not sure why I cannot find the directly link in this moodle website.
  • Picture of Maurício Reis
    Tue, Oct 3, 2017, 11:19 PM
    Hello Jean, first I must thank you for the long you keep this project up. It helped me a lot. I would like to know about this "adoption". Just a few moments ago the moodle administrator here in my institution reported a possible incompatibility of the Formula types question with another plug-in. He suspects it is due to incompatibility of Formula Type question with Moodle 3.3.1. If you can just point me out some directions, maybe I can see what I can do to keep the project alive, or at least contribute in some way.
    Again, thanks for the work you already did.
  • Picture of hon wai lau
    Mon, Oct 9, 2017, 4:28 PM
    First, you will need to understand what the problem is and the error messages. Then, you may locate the codes with the problem. You may ask the developers of the question engine for helps. Each upgrade have minor changes that may break the some plugins. There is a need for constant maintenance to change a small part of the code to make it work again. Or, you may help the documentations.
  • Picture of John Pap
    Sat, Jan 13, 2018, 1:26 AM
    Hi Jean-Michel, is there a way to ignore spaces AND to have math symbols such as * % in one answer ?
    For example I'd like to write : M ← (N * 2) % 4 (with left arrow, asterisk and modulo).
    Either in Formula or Algebra.
    Thank you.
Please login to post comments