# Forum: support

Monitor Forum | Start New Thread
 Nested Flat Threaded Ultimate Show 25 Show 50 Show 75 Show 100
 RE: new converter type [ reply ]By: Achim Zeileis on 2016-04-15 21:19 [forum:43134] Well, introducing stupid bugs and fixing them afterwards hardly qualifies for superpowers ;-) But I'm glad that it's working now. Let us know if you come across any further problems. Best wishes!

 RE: new converter type [ reply ]By: Thomas Petersen on 2016-04-15 21:05 [forum:43133] Hi Achim It seems to be working great you're a superman Thanks

 RE: new converter type [ reply ]By: Achim Zeileis on 2016-04-15 15:00 [forum:43132] Ah, I think this is a bug that I fixed a couple of weeks ago in the development version here on R-Forge. Could you install the most recent snapshot install.packages("exams", repos = "http://R-Forge.R-project.org") and try whether this fixes the issues?

 RE: new converter type [ reply ]By: Thomas Petersen on 2016-04-15 09:33 [forum:43121] In the screenshots you can see e.g. overline does display correct in the questiontext :O)

 RE: new converter type [ reply ]By: Thomas Petersen on 2016-04-15 09:29 [forum:43120] fourfold2.xml (4) downloads Thanks for a quick reply. I have linked to a google drive folder below with screenshots and the XML file https://drive.google.com/folderview?id=0B97NiZySEPcwb0t2TWZWRkgzRHc&usp=sharing I have tried to import the XML file to moodle versions Moodle 3.0.2 (Build: 20160111) Moodle 2.9.1 (Build: 20150706) I can see backslashes are omitted in the questiontext but not in generalfeedback :O)

 RE: new converter type [ reply ]By: Achim Zeileis on 2016-04-14 21:44 [forum:43116] Thomas, thanks for your message. I'm glad that the package is useful for you! I created an example .xml with the R code you posted. Importing it into our Moodle 3.0+ system worked fine and appeared correctly. I tried to use the .xml.zip you posted but I couldn't unzip it. Maybe you can re-post the unzipped .xml? Also include the version number of your Moodle system and possibly a screenshot of the exercise that is not working. Maybe that will help us track down the problem.

 RE: new converter type [ reply ]By: Thomas Petersen on 2016-04-14 20:45 [forum:43115] fourfold2.xml.zip (7) downloads Hello Achim Thank you for the exam package it's amazing :O) I use the package to create exercises for Moodle I can get the pandoc-mathjax converter to work with extype num and schoice, but when I try to create cloze extype exercises, the question part of the exercise does not display math correctly. The following command regarding the fourfold2 is an example of this: exams2moodle("fourfold2.Rnw",name="fourfold2",n=1,encoding = "UTF8",converter = "pandoc-mathjax") I have enclosed the XML file below, I hope you can help me :O)

 RE: new converter type [ reply ]By: Achim Zeileis on 2015-08-18 15:56 [forum:42464] In case anyone is still reading this and wants to try something similar: The development version of "exams" here on R-Forge now gained pandoc support - through re-using the pandoc support in the "rmarkdown" package. If one uses converter="pandoc" this internally uses "pandoc --mathml" and so leads to very similar results compared to "ttm". However, one can also use "pandoc-mathjax" or "pandoc-jsmath" etc. which should come close to what John wanted to try...

 RE: new converter type [ reply ]By: Achim Zeileis on 2014-06-02 15:33 [forum:41090] Dominik, thanks for checking this! My impression is that such a convertert that preserves LaTeX for the equations only would need more work (and thorough testing). At least if it should be as probably applicable as tth/ttm which are surprisingly reliable. It might be possibly to adapt the tth/ttm C code to accomplish this but a quick look showed that it wouldn't be a trivial task...

 RE: new converter type [ reply ]By: Dominik Ernst on 2014-06-02 13:03 [forum:41089] Hi John, thank you for you work. We tested the new converter with one of the example exercises from the exams package, namely tstat.Rnw. So far there seems to be some room for improvement. See here for a screenshot https://homepage.boku.ac.at/dernst/tstat.png . For example $s^2_{n-1}$ is converted to $$s^2_n-1$$ (omitting the curly braces makes the formula incorrect). \mu and \bar are omitted entirely ("[...] from the setpoint $$_0 = 125$$.", should have been "\mu_0"). Best regards Dominik

 RE: new converter type [ reply ]By: Achim Zeileis on 2014-05-31 08:40 [forum:41077] John, thanks for the updated information. So essentially the idea would be to replace all math environments with the escaped dollars and then call tth or ttm leaving the result with the $$...$$ environments, right? I haven't tried that with Moodle, yet. We in Innsbruck have only a bare bones Moodle installation for simple testing. But I'll ask my colleagues in Wien who have a full Moodle setup for teaching to give it also a try. However, I have tried it with MathJax (which also supports the $$...$$ notation). For simple cases the approach above works smoothly. However, it does not distinguish between inline and displayed math. Also eqnarray environments etc. do not fully work as desired.

 RE: new converter type [ reply ]By: John Hoopes on 2014-05-30 17:42 [forum:41076] I should also mention that even though the TeX notation filter in Moodle converts the LaTeX surrounded by $$...$$ into an image, that LaTeX is still editable when you go and edit the piece of content that it resides within. The same holds true for MathJax filters as well. Filters don't change the content actually saved in the Moodle database, just what gets rendered when it loads it to the screen.

 RE: new converter type [ reply ]By: John Hoopes on 2014-05-30 17:34 [forum:41075] transformers.R (10) downloads Hi again, thank you for the feedback. I'm actually more of a Moodle developer than an R one. Achim you are correct that the converter wasn't parsing the other LaTeX commands that would normally exist in a LaTeX document. In the attached file you can see my converter if statement updated to help fix that. Essentially it would convert inline latex/equations into the Moodle representation of parsing LaTeX. The TeX Notation filter in Moodle is a filter that comes pre-packaged in Moodle core. This filter is converts LaTeX to an image. Granted it doesn't provide the full extent of a LaTeX environment as it only loads in certain packages, but that is configurable on the server that Moodle is installed on. Documentation for that is here: http://docs.moodle.org/26/en/TeX_notation_filter And just as an aside. A filter in Moodle is a plugin that parses through text that is on its way to be printed to the screen. It looks for patterns using regex on the text being passed through to tell if the plugin should act on it. In this case the filter is looking for $$...$$ There are also MathJax filters as well to parse LaTeX into a nice looking representation Math in Moodle is meant to be more of an addition to the content. Meaning that it can handle equations and quite a bit of the LaTeX notation for creating equations, but it doesn't handle everything (by default that is) Basically what my gsub function is doing is finding the following: $$...$$ $...$ \begin{math} ... \end{math} $...$ and converts all to \$\$ before it passes through the ttm parser. the ttm parser will convert all of the latex to an HTML representation that parses the \\$ as a literal dollar sign, as well as converting the rest of the LaTeX into HTML. That conveniently leaves them at: $$...$$ which is the way Moodle's filters expect LaTeX to appear. In my transformers.R file I basically copied the the "ttx" converter into my converter to make it self contained, but it could be done a different way to keep duplicate code from appearing.

 RE: new converter type [ reply ]By: Dominik Ernst on 2014-05-19 11:42 [forum:41042] Hi John, I would agree that this patch in its current form would be only useful for a very limited use-case since it doesn't handle any latex besides \begin|end{math}. I would also agree to try and use a more general converter. Unfortunately it doesn't seem quite simple to add this into tth. Hence one approach might involve using pandoc (http://johnmacfarlane.net/pandoc/) which converts latex into HTML but in its default settings retains latex equations. Using this it might be possible to write a new converter which also handles your case. Possibly using the pander package from CRAN as well. Only drawback of pandoc that I can see ATM might be that it might involve a little more setup on operating systems other than Linux/UNIX. Regards Dominik

 RE: new converter type [ reply ]By: Achim Zeileis on 2014-05-17 09:21 [forum:41033] John, thanks for the suggestion. Generally, we try to provide output that is as natural as possible in the resulting format. So if there's native support for LaTeX in Moodle, we would have a look at it. I couldn't find any information about it in the Moodle XML docs, though. http://docs.moodle.org/27/en/Moodle_XML_format http://www.qedoc.org/qedoc/index.php?title=Moodle_XML_format Possibly this is not a Moodle feature but just using the MathJax plugin? And the main problem with the "ttt" converter you suggest above is that it doesn't convert any other LaTeX commands. So if there are commands for bold face/italics, tables, graphics, these would not be transformed to HTML (unless I'm overlooking something). Hence, it would be somewhat dangerous to add this to the CRAN package. What we would need is a version of the TeX-to-HTML converter that preserves mathematical formulas but converts everything else. This would be useful beyond Moodle, especially if MathJax is used for rendering the resulting HTML. But my feeling is one would have to adapt the C sources of the "tth" package for this. We have considered adding a workaround in R for this but didn't find a sufficiently easy/reliable way to do so. But maybe you have also looked at this? Best wishes, Achim

 new converter type [ reply ]By: John Hoopes on 2014-05-16 20:36 [forum:41032] Hi, I've been working with some professors who are interested in using the package to import their questions (in latex) into Moodle. One thing that came up was being able to have the inline latex/math be imported, but imported in such a way that could be read as latex within Moodle. Moodle has it's own built in TeX notation filter that can capture and parse inline LaTeX to an image. This allows the instructor to go into Moodle and still edit their LaTeX within Moodle as well if need be. Basically I just added an extra "else if" to the transformers.R file and also allowed another converter string in the function's var area. Basically I'm just doing a gsub for some of the inline math notation for LaTeX to using the Moodle double dollar sign. That double dollar sign in a text area signifies to the TeX notation filter to read it as LaTeX. This is the converter with the "else if": else if(converter == "ttt"){ add_dollars <- function(x){ gsub("(?

Thanks to: