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

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

por Ahmad Amer -
Número de respuestas: 7

Salam, 

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

Thanks


Promedio de valuaciones (ratings): -
En respuesta a Ahmad Amer

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

por Dominique Bauer -
Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de 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
En respuesta a Dominique Bauer

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

por Ahmad Amer -

Interesting!


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

En respuesta a Ahmad Amer

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

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

Here is what the question should look like:

Formulas_20200829_1531.png


En respuesta a Dominique Bauer

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

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

Thank you Dominique for your ongoing support
En respuesta a Ahmad Amer

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

por Dominique Bauer -
Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de 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 ↗)

Promedio de valuaciones (ratings):Useful (1)
En respuesta a Dominique Bauer

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

por 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!

En respuesta a Ahmad Amer

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

por Dominique Bauer -
Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de 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.