Any help on adding an exponent in the text as part of the answer for a calculated multichoice quiz question.
For example: What is the area of a square with sides of 3.0 m and 4.0 m?
The answer should read 12 m2.
How do I formulate the answer in the answer block to produce the exponent (I use wildcards for the size variables)?
Thank you it works, but it is rather limiting. I have tried to use html tags (<sup>2</sup>) but this does not seem to be recognized in the answer field?
If you are using a Windows computer to create your questions, place your cursor where you want m² to appear, type the m, then hold down the Alt key and type 0178 on your number keypad. Then let go of the Alt key after which you should get a superscript ².
I don't have a Linux computer handy at the moment, to check if they work the same, but basically, you are just typing another letter in the character set, that just doesn't have a dedicated key.
Also, if on windows, go to Start > Windows accessories > Character map. You can use it to find many other letters, even many foreign ones.
Thank you for the tip, I do use a windows machine. I guess there is no method then to do any custom sub/superscripts and only these workarounds for commonly used characters.
I think you might be able to do what you want with the Formula type question because with it you 'build' your question and answer display in a text widow that has an editor. Then it is just a matter of using the subscript and superscript tool buttons, or the Alt+number method. I don't have time to test it today as I was shutting down when I saw you reply. Will try tomorrow.
As I said in the previous message now that multichoice answers are used a lot in Formulas questions (just for history this feature was undocumented in Hon Wai Lau documentation, I discovered it when I studied the code ) I think they need a little more love to improve the display
I added some styling because the labels were too close from the radio buttons and i managed to have something similar both in Boost and More or Clean theme (this was NOT the easy part !)
But maybe you have already spotted some other change in the above screenshots? I added a numbering feature to the choices. I simply borrowed the one from the multichoice qtype (similar to what is doing calculated multichoice question type) to avoid the need to duplicate code.
So that means that the formulas qtype is now dependent of the multichoice qtype but as I think qtype_multichoice is installed on all Moodle websites this shouldn't be a problem for anyone.
I didn't bother to introduce a setting for the default value, the Formulas qtype simply use the one defined for the multichoice qtype.
I also introduced a new sigfig function (sigfig for significant figures) with two numerical arguments the first one is the float to be displayed and the second one is an integer : the desired number of significant figures. The function return a string ready to be displayed (it can't be a number as we need trailing zeros in some cases !)
I will post here when this version will be available in the Moodle plugin database
I am trying to use the Tex notation, like:
The administrator set the configs described in https://moodle.org/mod/forum/discuss.php?d=193975#p1260466, but also it doesn't compile the Tex scripts.
Someone knows how can I use latex notation in answers of this type of question?
I am using moodle 3.4.