Question types: Formulas question type
qtype_formulas
Maintained by
Jean-Michel Védrine
This is a question type plugin for Moodle with random values and multiple answer fields.
536 sites
238 downloads
29 fans
Moodle 3.0, 3.1, 3.2, 3.3, 3.4, 3.5
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.
Contributors
Please login to view contributors details and/or to contact them
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.
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!
Documentation page started at https://docs.moodle.org/28/en/Formulas_question_type . Please feel free to add or correct as needed.
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.
http://benedu2.net/styles.css
After making the changes you will need to clear caches at
Site administration>Development> Purge all caches
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?
Example:
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
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.
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.
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.
https://docs.moodle.org/29/en/Formulas_question_documentation
I am not sure why I cannot find the directly link in this moodle website.
Again, thanks for the work you already did.
For example I'd like to write : M ← (N * 2) % 4 (with left arrow, asterisk and modulo).
Either in Formula or Algebra.
Thank you.