Question types: Formulas question type

Maintained by Picture of Jean-Michel Védrine Jean-Michel Védrine
This is a question type plugin for Moodle with random values and multiple answer fields.
396 sites
20 fans

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, 11 Nov 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, 3 Dec 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!
  • Picture of Germán Valero
    Mon, 8 Dec 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, 19 Oct 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, 29 Nov 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, 29 Nov 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, 29 Nov 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, 3 Apr 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, 4 Apr 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, 9 Apr 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, 9 Apr 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.
Please login to post comments