7x = 3x + 24 (calculated)

7x = 3x + 24 (calculated)

- Ahmad Amer の投稿
返信数: 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

Ahmad Amer への返信

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

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 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.

Dominique Bauer への返信

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

- 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!
Ahmad Amer への返信

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

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 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?
Dominique Bauer への返信

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

- Ahmad Amer の投稿

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

添付 IMG_1613.jpg
添付 IMG_1614.jpg
Ahmad Amer への返信

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

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers
Hello Ahmad,

Sorry. Actually, the roots are -5 and 3.
Dominique Bauer への返信

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

- 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
Ahmad Amer への返信

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

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers
Dominique Bauer への返信

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

- Ahmad Amer の投稿
Thanks Dominique,
It accepts the answers -5 3
but not 3 -5
!
Ahmad Amer への返信

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

- 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?
Ahmad Amer への返信

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

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers
Dominique Bauer への返信

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

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