Skip to content

Commit

Permalink
feat: add tip to disable mathjax processing for an element
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Sep 13, 2023
1 parent 630ebd3 commit 958aed7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions en_us/shared/exercises_tools/text_input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Editing Text Input Problems using the Advanced Editor
*********************************************************************

If the simple editor is not enough to meet your needs, you can switch over to the
advanced editor. In the setting panels on the right of the editor, click
**Show advanced settings**, then scroll down and click
advanced editor. In the setting panels on the right of the editor, click
**Show advanced settings**, then scroll down and click
**Switch to advanced editor**.

You can use the advanced editor to identify the elements of a text input problem
Expand Down Expand Up @@ -342,6 +342,29 @@ Patterns", "string patterned", or "STRING PATTERNING" are all scored as
correct, but learners who submit an answer of "Strings Pattern" or "string
patern" are scored as incorrect.

=========================
Disable MathJax rendering
=========================

You can configure a text input problem to accept raw expressions which could
resemble functions that are processed by MathJax by default. Sometimes this
might not be the expected behaviour, i.e., you want to accept raw expression as
well as display (show answer) it in its raw form. You can do this by simply
enclosing ``<stringresponse>`` element in ``<annotation-xm>`` tag. All elements
inside this tag will be ignored by MathJax processor. An example follows.

.. code-block:: xml
<problem>
<annotation-xml>
<stringresponse class="tex2jax_ignore" answer="\s*n\s**?\s*x\[\s*n\s*\]\s*" type="ci">
<div>Question</div>
<additional_answer class="tex2jax_ignore" answer="or \s*x\[\s*n\s*\]\s**?\s*n\s*"></additional_answer>
<textline size="20"></textline>
</stringresponse>
</annotation-xml>
</problem>
.. _Text Input Problem XML:

********************************
Expand Down

0 comments on commit 958aed7

Please sign in to comment.