Formula: When the answer box is within the equation (not at the end)

Formula: When the answer box is within the equation (not at the end)

بذریعہ Ahmad Amer -
جوابات کی تعداد: 5

Salam Alykom,

In the attached question, the answer box is within the equation (NOT at the end).

 I tried many times but it did not work.


منسلکہ Screen Shot 2020-08-24 at 10.38.20 AM.png
درجہ بندی کا اوسط: -
Ahmad Amer کے جواب میں

Re: Formula: When the answer box is within the equation (not at the end)

بذریعہ Dominique Bauer -
Documentation writers کی تصویر Particularly helpful Moodlers کی تصویر Plugin developers کی تصویر

You can easily insert variables into equations, but to my knowledge, you cannot insert an input box.

So do it the same way. Simply add some space to the exponent with \hspace{} and position the input box as required.



\(\large{ \dfrac{{a}^{{n1}}\times {a}^{\hspace{25px} + {n2}}}{{a}^{{n3}}} = {a}^{{n4}}}\)
<div style="display:inline-block; position:relative; font-size:80%; font-family:'Times New Roman'; left:-104px; top:-22px;">{_0}</div>
درجہ بندی کا اوسط:Useful (1)
Dominique Bauer کے جواب میں

Re: Formula: When the answer box is within the equation (not at the end)

بذریعہ Dominique Bauer -
Documentation writers کی تصویر Particularly helpful Moodlers کی تصویر Plugin developers کی تصویر
I also suggest that you follow the recommendations of the International System of Units (see the SI brochure ↗) when writing the multiplication of numbers, i.e. to use \times, not \cdot:


درجہ بندی کا اوسط:Useful (1)
Dominique Bauer کے جواب میں

Re: Formula: When the answer box is within the equation (not at the end)

بذریعہ Ahmad Amer -

When I used the code you provided in the previous post, I got my answer box in a different spot (as it shows in the screenshot)!

How do I deal with such a problem (Do I play with the pixels or is there another way to deal with it)?

Thanks


Ahmad Amer کے جواب میں

Re: Formula: When the answer box is within the equation (not at the end)

بذریعہ Dominique Bauer -
Documentation writers کی تصویر Particularly helpful Moodlers کی تصویر Plugin developers کی تصویر
You must include the same JavaScript code as in the other questions, get the right size of the input box and play with the pixels.

Note that this is about formatting input boxes. This formatting is not specific to the Formulas question, you could apply it to any other type of question. It is not a standard feature of any type of question.

If you want to format input boxes the way I suggested, you need to have some basics of HTML and JavaScript to do it properly, at least try to understand a little bit the HTML code of the questions I've prepared for you. مسکراہٹ

Do not hesitate to attach an XML file of your question and to formulate your post by referring to the formatting code of the input box.