marcusgreen / moodle-qtype_gapfill

Fill in the blanks question type with very easy to learn syntax
6 stars 20 forks source link

Equation not rendering when using equation in gap filled question #71

Open crystalvaughn opened 3 years ago

crystalvaughn commented 3 years ago

When using a table with multiple rows in a gap filled question, if an equation is entered into the first cell of the table, Mathjax does not convert the equation. This seems to only happen if the first cell in the table is blank. If the equation is placed in the first cell of the table then it renders correctly.

2021-04-05_14-13-42

2021-04-05_14-12-31

marcusgreen commented 3 years ago

Could you export to xml and attache the question to a comment here. I generally do not recommend this question type for any numerical/mathematical work. This question type by contrast is specifically designed for such things, and the person who supports it is excellent. https://moodle.org/plugins/qtype_formulas If you want the ultimate math quiz questions then stack question type awesome but complex to set up. https://moodle.org/plugins/qtype_stack However I'd be happy to help you configure that up.

crystalvaughn commented 3 years ago

Yes here is a copy of the XML file of the question

questions-quiz-Gapfill test (copy)-20210405-1549.zip

marcusgreen commented 3 years ago

I have no idea why, but if you put () just before the table the MathJax seems to render. I tried on a core question type wordselect and this issue does not manifest, so it implies an issue in the parsing code in renderer.php in Gapfill.

chen21590 commented 2 years ago

I have the same problem without any table [](url questions-מטמטיקה - 7 class 19 - Admin User - (2)-שאלה של אלנט - בניה מחדש-20211109-1551.zip ) you can solve this by adding $output = format_text($output, FORMAT_HTML, ['noclean' => true]); before you return the output in rendere.php

marcusgreen commented 2 years ago

I will investigate