7x = 3x + 24 (calculated)

7x = 3x + 24 (calculated)

by Ahmad Amer -
Number of replies: 13

Salam Alykom

I created the following:

\( {a} \times x = {b} \times x + {c} \)

 with the following answer formula: {c} / ({a} - {b})

 Few questions:

1) Am I doing right?

2) Should I use calculated or calculated simple

3) Is it possible to make sure that x - ({c} / ({a} - {b}) - is always positive and an integer (no fractions or decimals)


Shukran - thank you

Average of ratings: -
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

And peace be upon you, too.     وَعَلَيْكُمُ ٱلسَّلَامُ

You should use the "Calculated" question type.

The equation to solve is:

\[{ax=bx+c}\]

Rearranging, we have:

\[{x=\dfrac{c}{a-b}}\]

Let \({a-b}\)  be equal to a positive integer, say:

\[{a=b+d}\]

Where \({x}\), \({b}\) and \({d}\) are random positive integers from three ranges (identical or different from one another), for example:

\[{x=\{3:13\}}\]

\[{b=\{3:13\}}\]

\[{d=\{3:13\}}\]

To write the equation in the question text, it is easier to use MathML rather than LaTeX because LaTeX has {} which interferes with the variables of the Calculated question, while MathML does not have {}.

The HTML code of the question text should therefore look like this:

<p>
    Solve the following equation for <math style="font-family:stix"><mstyle mathsize="18px"><mi>x</mi></mstyle></math>:
</p>

<p style="text-align:center;">
    <math style="font-family:stix"><mstyle mathsize="18px"><mn>{=({b}+{d})}</mn><mi>x</mi><mo>=</mo><mn>{b}</mn><mi>x</mi><mo>+</mo><mn>{={x}*{d}}</mn></mstyle></math>
</p>

The rest is pretty standard. I have attached an XML file for your question.

Average of ratings:Useful (2)
In reply to Dominique Bauer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -
Thank you very much Dominique.
It works very well.

I wonder whether there are available MathML resources of other codes for different math questions that can be used automatically as HTML codes!
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Ahmad,

Here (moodleformulas.org)  you will find an exhaustive list of free online editors to get the LaTeX and MathML codes of an equation.

With some of these editors, you can enter the equations by hand (MyScript) or capture an equation displayed on any web page (EquatiIO). Quite nifty.    

Did I understand correctly and answer your question?
In reply to Dominique Bauer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -

I have tried the following but it did not work as expected!!

Attachment IMG_1613.jpg
Attachment IMG_1614.jpg
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Ahmad,

Sorry. Actually, the roots are -5 and 3.
In reply to Dominique Bauer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -
When I click on "FILL ON CORRECT RESPONSES" it gives 1 and 1 !!!

These are the correct answers in my moodle after importing the xml file !!1
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Ahmad,

Attached is the corrected XML file.

In reply to Dominique Bauer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -
Thanks Dominique,
It accepts the answers -5 3
but not 3 -5
!
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -
and one more question (not related to the above)
In the link https://moodleformulas.org/login/index.php the username and password appears automatically without typing them. How to do this?
In reply to Ahmad Amer

Re: 7x = 3x + 24 (calculated)

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Dominique Bauer

Re: 7x = 3x + 24 (calculated)

by Ahmad Amer -
Thanks Dominique,
This one gives the answers 1 and 1 too.
When I click on "FILL ON CORRECT RESPONSES" it gives 1 and 1 !!!

These are the correct answers in my moodle after importing the xml file !!1

I can see: Grading criteria* (_0 == root1 && _1 == root2) || (_0 == root2 && _1 == root1) but the answers are 1 and 1!!!