Formula questions - how to enter\require a constant (x) as an answer?

Formula questions - how to enter\require a constant (x) as an answer?

von Ahmad Amer -
Anzahl Antworten: 7

Salam, 

How do I enter and use a constant (x) as an answer for my equations?

Thanks


Als Antwort auf Ahmad Amer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers

Note that students could use one of the many simplify calculators available online. Just search "Simplify calculator" on Google. Here are two examples:

Formulas_20200829_1401.png

Formulas_20200829_1402.png
Als Antwort auf Dominique Bauer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Ahmad Amer -

Interesting!


How can x (as a string) be part of the answer in formula questions?

Als Antwort auf Ahmad Amer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers
You have to use the "Algebraic formula" answer type.

Here is what the question should look like:

Formulas_20200829_1531.png


Als Antwort auf Dominique Bauer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Ahmad Amer -
How can I make both x and X correct answers (capital and small letters).

Thank you Dominique for your ongoing support
Als Antwort auf Ahmad Amer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers

Hello Ahmad,

If I understand your question correctly, you also want to accept the uppercase \(X\) as a correct answer which, strictly speaking, is the lowercase \(x\).

In this case, all you have to do is set X=x; in the Global Variables section of the question. You could also add a message stating that usually \(x \neq X\).

Here is what the question should look like:

Formulas_20200901_1501.png

(Last question at https://moodleformulas.org/course/view.php?id=78§ion=3 ↗)

Als Antwort auf Dominique Bauer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Ahmad Amer -

Thanks indeed Dominique,

I wonder why presenting the questions one question per page looks different than all questions in one pages - the boxes change their places ! Is there a way to overcome such a behavior!

Als Antwort auf Ahmad Amer

Re: Formula questions - how to enter\require a constant (x) as an answer?

von Dominique Bauer -
Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers
It would obviously be preferable for the Formulas question to include settings for the custom size, position and font of the answer boxes. While waiting for this to be done, I have proposed a method based on JavaScript code defined on the user side. This solution is quick and easy to apply, but it certainly has limits.

JavaScript code applies to an entire page. When only one question is displayed on a page, the first answer box is also the first for the JavaScript code, but when there are multiple questions on the same page, the first answer box of the different questions no longer matches the JavaScript code instructions for the first answer box. In other words, there is no longer a single first and second answer box, but third, fourth, fifth, etc.

You must therefore adjust the JavaScript code accordingly. It's not difficult, but it gets a bit tedious. If you have quizzes with random questions, this is almost no longer possible.

Unless this is a major inconvenience for you, I suggest that you keep one question per page for now.