TeX in drag and drop question

TeX in drag and drop question

by Kathrin Braungardt -
Number of replies: 6
Picture of Testers

hi there,

reading through some related posts but could not find a good answer: we have a drag and drop question with tex code inside the drop elements. the tex code does not display correctly. it is moodle 3.1 with tex and mathjax configured. any hints and help are welcome,

Kathrin

Average of ratings: -
In reply to Kathrin Braungardt

Re: TeX in drag and drop question

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Since no one else answered, I will take a stab at it. I am pretty sure that the problem is due to the text inside the drop elements are not being filtered by either the MathJax or Tex filters, so the text never gets turned into a picture. If this is correct, the code for the question type would have to be rewritten to make it work.

In reply to AL Rachels

Re: TeX in drag and drop question

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This is probably intentional. There are quite strict lmits on what can go in the drag items, becase if the content is not just one line of text, things can break.

It would be really good if this question type could be extended to cope with a wider range of content.

In reply to Tim Hunt

Re: TeX in drag and drop question

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

I actually had pretty good results using MathJax in the drag and drop text question before the filter was developed. To do this MathJax needs to be set up in the additional HTML setting. MathJax is reliable enough to not cause problems.

A better solution would be however to use the drag-and-drop matching question type if it fits the need. I believe that one does work with either filter.

In reply to Kathrin Braungardt

Re: TeX in drag and drop question

by Ralf Otto -

Hello,

Kathrin and i (we are work colleagues) found a way to use Mathjax in Drag&Drop questions.
If you deactivate the Mathjax filter in your assessment and add following code to your question,
Mathjax code will be displayed:

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>

If you have a local copy of Mathjax on your server, you can change the url to it.

I know this isn't a good solution, but if you really need to display Mathjax in your D&D questions, it works smile


Best Regards
Kathrin and Ralf


In reply to Ralf Otto

Re: TeX in drag and drop question

by Ralf Otto -

FYI: The Method i described to use Mathjax in Drag&Drop-Questions works with Moodle 3.1, but doesn't work in Moodle 3.4 

In reply to Ralf Otto

Re: TeX in drag and drop question

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hello Ralf,

The way the filter loads its configuration was changed a few times (beginning in 3.2). The filter's configuration now is loader even if the filter is disabled. This potentially could interfere with Mathjax being loaded and configured by other means. You may try setting the filter's config to blank and see if that works.

I would also look at the browsers console and the source code for the pages to see if there are errors.