Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84201

Mathjaxloader skips some subquestions in Cloze questions

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • Hide

      1. The MathJax filter must be active in the site with the default settings (Site administration -> Plugins -> Filters).
      2. For better look of equations in MathJax filter settings the option "TeX filter compatibility" (filter_mathjaxloader | texfiltercompatibility) should be turned ON.

      3. In any existing course open Question bank
      4. Create a new question of type: Embedded answers (Cloze), with name: Cloze-T6
      5. In question text editor open Tools -> Source code
      6. Paste the following HTML text, then click Save:

       

      <p><span style="font-size: small; color: #008080;">Fill the blanks.</span></p>
      <p> </p>
      <p><span style="font-size: medium;">By the theorem of integration by substitution we have:</span></p>
      <p><span style="font-size: medium;">$$\bullet \
        \ \displaystyle\int \tfrac{\sin \sqrt{x}}{\sqrt{x}}dx= \{ t =
        $${1:MC:~sin x~1/x~=√x~1/√x~sin√ x}$$ \} = $$ {1:SA:=2} $$ \displaystyle\int
        \sin tdt$$</span></p>
      <p> </p>
      <p><span style="font-size: medium;">$$\bullet \ \ \displaystyle\int
        \tfrac{3\ln^3 x}{x}dx=\{t=$${1:SAC:=lnx~=ln x}$$\}\displaystyle =
        $$</span><span style="font-size: medium;">{1:SA:=3} </span><span
        style="font-size: medium;">$$\displaystyle\int t^3dt$$</span></p>
      <p> </p>
      <p><span style="font-size: medium;">$$\bullet \ \ \displaystyle\int
        \sqrt{2x+1}dx=\{t=$${1:SAC:=2x+1~=x+1/2~=x+0,5}$$\}
        =$${1:SA:=1/2~=0,5~=0.5}$$\displaystyle\int t^{\frac{1}{2}} dt$$</span></p>
      <p> </p>
      <p> </p>
      <p><span style="font-size: small;"><span
         style="color: #ff0000;"><strong>Attention! </strong></span>We use symbols:
          a^b = $${ a^{b}}$$,   a/b =$${\frac{a}{b}}$$</span></p> 

       

      7. Click the "Decode and verify the question text" button, confirm there are 6 subquestions (1 Multiple choice and 5 Short answer).
      8. Click the "Save changes and continue editing" button
      9. Afterwards click the "Preview" option, or in questions list open preview for this question (Edit menu -> Preview)
      10. The preview will display incorrectly three HTML text sequences instead if browser controls:

      • <span class="nolink">qtypemultianswer1marker</span>
      • <span class="nolink">qtypemultianswer3marker</span>
      • <span class="nolink">qtypemultianswer5marker</span>
      Show
      1. The MathJax filter must be active in the site with the default settings (Site administration -> Plugins -> Filters). 2. For better look of equations in MathJax filter settings the option "TeX filter compatibility" (filter_mathjaxloader | texfiltercompatibility) should be turned ON. 3. In any existing course open Question bank 4. Create a new question of type: Embedded answers (Cloze), with name: Cloze-T6 5. In question text editor open Tools -> Source code 6. Paste the following HTML text, then click Save:   <p><span style= "font-size: small; color: #008080;" >Fill the blanks.</span></p> <p> </p> <p><span style= "font-size: medium;" >By the theorem of integration by substitution we have:</span></p> <p><span style= "font-size: medium;" >$$\bullet \   \ \displaystyle\ int \tfrac{\sin \sqrt{x}}{\sqrt{x}}dx= \{ t =   $${ 1 :MC:~sin x~ 1 /x~=√x~ 1 /√x~sin√ x}$$ \} = $$ { 1 :SA:= 2 } $$ \displaystyle\ int   \sin tdt$$</span></p> <p> </p> <p><span style= "font-size: medium;" >$$\bullet \ \ \displaystyle\ int   \tfrac{ 3 \ln^ 3 x}{x}dx=\{t=$${ 1 :SAC:=lnx~=ln x}$$\}\displaystyle =   $$</span><span style= "font-size: medium;" >{ 1 :SA:= 3 } </span><span   style= "font-size: medium;" >$$\displaystyle\ int t^3dt$$</span></p> <p> </p> <p><span style= "font-size: medium;" >$$\bullet \ \ \displaystyle\ int   \sqrt{2x+ 1 }dx=\{t=$${ 1 :SAC:=2x+ 1 ~=x+ 1 / 2 ~=x+ 0 , 5 }$$\}   =$${ 1 :SA:= 1 / 2 ~= 0 , 5 ~= 0.5 }$$\displaystyle\ int t^{\frac{ 1 }{ 2 }} dt$$</span></p> <p> </p> <p> </p> <p><span style= "font-size: small;" ><span    style= "color: #ff0000;" ><strong>Attention! </strong></span>We use symbols:     a^b = $${ a^{b}}$$,   a/b =$${\frac{a}{b}}$$</span></p>   7. Click the "Decode and verify the question text" button, confirm there are 6 subquestions (1 Multiple choice and 5 Short answer). 8. Click the "Save changes and continue editing" button 9. Afterwards click the "Preview" option, or in questions list open preview for this question (Edit menu -> Preview) 10. The preview will display incorrectly three HTML text sequences instead if browser controls: <span class="nolink">qtypemultianswer1marker</span> <span class="nolink">qtypemultianswer3marker</span> <span class="nolink">qtypemultianswer5marker</span>

      In our Moodle installation we have two filters enabled: MathJax and TeX Notation (for compatibility with existing materials). MathJax filter takes precedence, since it is configured with higher priority.

      Recently we have found that MathJax renders some Cloze questions incorrectly, leaving HTML text like:

      <span class="nolink">qtypemultianswer1marker</span>

      instead of expected controls: text boxes, select lists, etc. See attached screenshots of how it behaves now and what is the expected outcome.

      After disabling MathJax in course settings the legacy TeX Notation filter works correctly with exactly the same Cloze question - but it renders the math equations with different look (less nice).
      Turninig on "TeX filter compatibility" (filter_mathjaxloader | texfiltercompatibility) didn't help much here.

      I was able to find some other issues possibly related to that, but they didn't help either: MDL-61981, MDL-47712, MDL-81291.

        1. Cloze-MathJax-expected3.png
          73 kB
          Wiktor Wandachowicz
        2. Cloze-MathJax-expected2.png
          87 kB
          Wiktor Wandachowicz
        3. Cloze-MathJax-expected1.png
          70 kB
          Wiktor Wandachowicz
        4. Cloze-MathJax-error.png
          85 kB
          Wiktor Wandachowicz

            Unassigned Unassigned
            wiktorw Wiktor Wandachowicz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.