Replace your existing dlg_ins_smile.php with the one included in the archive (this deletes the line that adds the doubleddollar delimiters. )
The config.xml file replaces the file of the same name in your dragmath/applet/ classes directory. It only identifies a new export format described below.
Latex.xml and ASCIIMathML.xml need to be placed in dragmath/applet/classes/formats. Latex.xml will simply replace the existing Latex.xml and the only change here is that the doubledollarsigns that were inserted for tex interpretation by the integration script (see above) have been moved to the Latex.xml file using the <Initial> tags.
The other file ASCIIMathML.xml, is named after that package/script/filter written by Peter Jipsen http://www1.chapman.edu/~jipsen/mathml/asciimath.html because the xml file employs backticks as delimiters and begins an attempt to provide ASCIIMathML conversion for dragmath in addition to true tex. At present its major benefit is avoiding insertion of square bracket and encapsulating text expressions in backticks, thereby invoking the asciimathml filter. You could replace the backticks with amath and endamath if you so choose.
In this manner dragmath could be used to create filter specific text expressions.
Thanks to Chris and Pete for their assistance. As Chris suggested, one could also create a moodletex.xml that added the doubledollars for filters and leave the Latex.xml as is for when you do not want the delimiters. The format and syntax are relatively easy to manipulate.
Re: Dragmath integration - Extending functionality - files
Marc,
I shall include the ASCIIMathML.xml file into DragMath on SourceForge, and I shall make a moodletex.xml from your Latex.xml, so that people can use the existing Latex.xml as well.
Adding these will allow people who want to use these files in Moodle able to easily upgrade to newer versions of DragMath while keeping the files.
Then the standard integration of DragMath in Moodle could set moodletex.xml as the default format?
Alex
www.dragmath.bham.ac.uk
Re: Dragmath integration - Extending functionality - files
Anthony Borrow is in the process of moving DragMath into the CONTRIB section of the moodle cvs repository so that we have better control over versioning. He is still working out the details of how it will be done, since DragMath is not a standard plugin, but rather an integration. Once our cvs is up and running, we will fix the smiley button issue and make these other valuable changes.
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
Anthony
Have you installed TinyMCE, that includes Dragmath, in Moodle 1.9 (final)? I did it but the editor is not running in firefox, but it is with IE7. In IE7 the dragmath applet is not found - all the other functionalities are working.
Do you have any idea of what could be the problem?
Thanks for your help.
Luis
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
http://moodle.org/mod/data/view.php?d=13&rid=1119
In the documentation section you will find the info for installation.
Thanks for the excellent work that you are doing in the Moodle community.
Luis
Marc
I have no idea. I downloaded the Tinymce3 file that its available at
http://moodle.org/mod/data/view.php?d=13&rid=1119 an installed it in my
Moodle 1.9 final version. The advantage of this one is that it includes the
tinymce and tha dragmath applet integrated.
Luis
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
The problem in Glen's TinyMCE integration is in the path and in file dragmath.php:
line starting with codebase should be:
codebase="<?php echo $CFG->wwwroot.'/lib/editor/tinymce3/plugins/dragmath/applet/classes' ?>"
and if dragmath is as a plugin in folder lib/editor/tinymce/jscripts/tiny_mce/plugins then codebase should be given by tags
codebase="<?php echo $CFG->wwwroot.'/lib/editor/tinymce/jscripts/tiny_mce/plugins/dragmath/applet/classes' ?>"
Works ok in IE7 as well...thank you for a great plugin!!!
Re: Dragmath integration - Extending functionality - files
As I came across Chris' name first on the DragMath page than yours I have been chatting him up about this via e-mail.
Let me cover a couple of points from our correspondence as well as my "private" concerns:
a) I was hoping to address a question I had about the usage of /cdot. If I delete the /cdot stanza from the xml file so as to avoid, for example {2 /cdot ab} which is what dragmath produces if you do "2ab" , you cannot then intentionally insert the dot if you want to use it, which is not an advancement...... I suggested to Chris that I thought the java was inserting the /cdot in this instance (whenever it saw a coefficient in a term), and where as there was nothing wrong with it and it was technically correct, not everyone wanted a dot behind every coefficient.... and I wondered whether deleting that automated insertion was "trivial" or not.
b) I think the key to avoiding unnecessary frustration in the transition is to ensure that the default format file IS set to moodletex.xml so as to make sure that there aren't then lots of posts about double doubledollars signs... I have attached a file that sets this as default and also is format neutral as far as the function... which makes no practical diff, but I think adds clarity. And I assume you will add the moodletex.xml item to config.xml
c) I mentioned to Chris that I had assumed that the applet would simply read the formats and languages directories, as opposed to requiring identification of these in config.xml and he said he would bounce that off you as he thought there had been perm issues....
d) While Peter Jipsen has I think appropriately noted that one of his interests in developing ASCIIMathML was to avoid the necessity of a gui, I thought that offering students the ability to start with the gui and and see the asciitex made good pedagogical sense. A full XML mapping is going to require more work than my current ASCIIMathML file reflects, but pending a simple resolutions of issues such as square brackets in ewiki it does serve a purpose and will if nothing else afford backticks as delimiters for those using ASCIIMathML as a filter, so I would like to see that included in any distro in the hope (slim perhaps but nevertheless there) that someone may beat me to completing the asciimathml xml file ;=}
e) Having looked over much of the work Peter has put into integrating adciimathml into htmlarea and xinha, I am concerned that the decisions regarding the new editor to be core moodle take into account the need to accomodate scientific and mathematical notation "out of the box" and whated to simply opine to the ether here that whether FCKEd., tinyMCE or some other candidate is chosen, it wold be nice if the moodle version had easily managed hooks, API, etc (I smile every time I notice where my smileys no longer appear in htmlarea....) Is anyone looking at this or talking to editor/ wiki developers about such matters?
Thanks for all the work you and others have done on this!
Re: Dragmath integration - Extending functionality - files
In response to your questions:
a) DragMath does insert a dot whenever it parses text and sees a coefficient. Removing the automated insertion would be trivial, however as DragMath works with other formats such as Maple and Maxima, not just LaTeX, removing it would cause problems. As LaTeX is presentational it doesn't matter if we write '2x' or '2*x'. Formats like Maple and Maxima will only accept '2*x' though. The only way I can think to achieve this without creating a Moodle/LaTeX specific DragMath version, is to offer the user an option within the program to turn on/off the automatic insertion?
c) The config.xml file was for implementation purposes, as I did not find a way to list the files in a directory that weren't local.
d) As I know the structure of the xml format files best, it would probably be easiest for me to complete the asciimathml file. I would just need to look up the syntax for asciimathml.
I shall add these changes as feature requests to the SourceForge project.
Alex
Re: Dragmath integration - Extending functionality - files
I was afraid the dot would present issues with other filters. Can the "switch" you mention be invoked automagically by tying it to the export format? This might have additional uses, as well, if such switches could be included in the format's xml (e.g. <JavaFunction><nodotinsert=true></JavaFunction>.) But I am thinking that also may mean there may be state issues involved? I am not looking to make more work for you, really! ;=} What do you think?
Peter Jipsen provided this reference to me,
The basic description of the syntax is at http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html (yes, it is pretty brief).as far as asciimathml syntax and indicated that about as much as there is.....
Marc
Re: Dragmath integration - Extending functionality - files
Marc,
An option in the format's xml file would make sense, then DragMath can determine whether or not to include the syntax for the dot when it is creating the output syntax.
I have added MoodleTex and ASCIIMathML files to the DragMath CVS on SourceForge. I tried to convert as much of the ASCIIMathML as possible.
The files can be viewed here:
http://dragmath.cvs.sourceforge.net/dragmath/ddma/formats/
Re: Dragmath integration - Extending functionality - files
Could not find the files in the Moodle CVS but did find it in yours. I checked them out and want to point out that the MoodleTex.xml file, while providing the double dollars in the Initial tag, does not avoid the square bracket issue, which I think is what is intended (i.e. MoodleTex is only the Latex file with the initial tags) . As a matter of curiosity does the moodle tex filter interpret /root and if so, should we use /root for Nth Root in MoodleTex until Moodle 2.0's release provides an Nwiki with more advanced tagging, escaping, etc? The ASCIIMathML file seems to work just fine and we are putting it through its paces. Thanks!
As far as adding extra tags to address such matters as the insert of the /cdot, which src file accomplishes this and are there other instances in which it does interpretation prior to using the format file to parse the text?
I was also wondering if you knew what format OpenOffice used for text expressions. Truth of the matter is that is where this started for me (a teacher here was doing all his Math assignments in OpenOffice and he became distressed when the text expressions OOo produced did not seem to be interpreted correctly by anything except OOo. It has some nice tools (including the ability to produce MathML, gifs and go back and forth between text expression and MathML but I can't seem to find anything about the syntax of its text expressions.
Re: Dragmath integration - Extending functionality - files
I'm not sure whether we should use \root or not in Moodle. If needed I can change the syntax in the Moodletex file.
I know nothing of the OpenOffice expressions.
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
Was this a general heads up or with respect to specific issues? I think everything moodlish we have discussed already other than a future change in the java code to exclude assumed usage of cdot has been addressed. Isn't that correct Alex and John? Do I need to take an additional step with respect to the mod that deletes the insertion of the double dollars in the integration file or has this already been done? Is the dragmath code going to live somewhere other than at the dragmath site?
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
I have been confused about DragMath since Day One. I will gladly stand aside and let Marc take over the version in contrib if (a) Marc wants the responsibility and (b) Anthony approves.
Re: Dragmath integration - Extending functionality - files
I think that John is the man by acclamation. But I also think we need to help him out, as he has I think suggested, by trying to promote the use of the CVS and providing some easy guidelines for people who have code to offer... Is that a reasonable way to put tnat John? A forum can be a bewildering place and uploading code a bit intimidating.
Thanks for the kind words, but I respectfully disagree: I'm not doing a great job. I'm not doing any job! I became frustrated with social-constructionist version control and decided to exit the game a while ago. I haven't been following the discussions of ASCIIMathML, moodletexml, TinyMCE, etc., although I'm sure they are important and interesting discussions.
IMO we should not offer a "full integration package" -- i.e., an all-in-one zip file that you "simply unzip in your rootdir" -- even though that's what the users obviously want. It invites the versioning problems and will lead the posting of even more all-in-one zip files in the forums.
In particular, I feel strongly that we should not make copies of the DragMath editor. Users should download it independently from SourceForge, where Alex and Chris maintain it. Alex and Chris should be able to update it at any time they like without having to coordinate with Moodle, unless the change breaks an interface, in which case they should give us a heads-up.
DragMath integration is a patch. Like other 3rd-party patches, it should be a collection of diff files made with the Unix diff command that can be applied to Moodle core files using the Unix patch command. Of course this will not be popular with users in the Math Tools forum, and they won't do it. Someone will come along with an all-in-one zip file, and that person will be a hero until version issues creep back in and the "DragMath doesn't work" posts start again. IMO it's a losing battle.
I think that part of the "job", John, sometimes a the most difficult part, is channeling all this energy; like herding cats. I think you are being a bit too hard on yourself in that you are the reason we are having this discussion.... it is a critical discussion for the reasons you note.
I support quite a bit of what you are saying, but, a cat is a cat after all, and I have to have a few caveats of my own ...
If I hear distant trumpets calling over a dispute as to whether dragmath integration should become a full dragmath moodle plugin, module, etc I think I have to agree that in this respect we are I think over stepping the bounds I think (did I stick enough "I thinks" in there.....?) DragMath has, as I think I mentioned earlier, functionality and application beyond Moodle. If anyone were to take that on such a unitized package, I would have to argue it would be Alex (though breathe easy Alex as I am not arguing for that either - at least at present ;=} ) as it is their app.
On the other hand, as a user I would dearly love to see a slam bam solution... and I have spent a good deal of time because the user I was supporting was lost in space and I was volunteered ..... So, I would support an integration that would be as simple as putting folder X in path Y. Then again, I think you should be able to upload and add modules from inside the moodle interface, so its not like I have my finger on the pulse of the community!
That being said, I see a larger problem in that we want to support use of Math in moodle, or for that matter, any alternative orthography, so if someone from SRA wants to demo some Reading Mastery (praise be to all copyrights and the holders thereof) access to applets that allow one to insert mathml or any other xml schema that can be accomplished, both from the standpoint of construction (the creation of whatever is necessary to enable display, as in DragMath) or display (which is separate and apart, woe is us, from construction). Peter Jipsen I think had it closest in trying to use the same set of tools for contraction as well as display when he modded htmlarea and xinha to do asciimathml. BUT, here we have to address whether the moodle should remain constructor and display neutral, or adopt specific technologies as core or moduled elements.
From the user perspective, having a super duper editor that does everything lighting fast with no detrimental impact on anything and works in every browser is top o' the list.... (wait, can't you just hear the cats meowing again) However, while the argument was one of the nobler I have heard, the recent discussion of nwiki vs ouwiki was enervating and one need only put an ear to the disputes between phpgroupware and egroupware to see just how difficult things can get when you talk about singling out this or that.
I am therefore firmly and positively on the fence.... I want everything and I want it easy.... but I want to make sure that those who want sugar in their coffee and milk in their tea have that option.... no matter the senselessness of such ideas.... milk, indeed!
To me that suggests that moodle developers suggest, propose, design, what have you an API for html editor plugins and ask the html editor developers and the plugin editors (and in this view DragMath would be an editor plugin) to think about working towards that interface. That eliminates the integration issue altogether, in the fullness of time (does someone hear meows....) How does it go, "We can change. If we have to. I guess.."
And display wise it would be nice if moodle would support tools that displayed everything you through at it, one reason I like asciimathml (and will love it if it will do openoffice math ext expressions as well) though it seems to me that rather than filter every page we should be able to tag what pages need filtering. Open, universal, easy.
Short term: one folder, no edits, KISS. No grand schemes unless those who are maintaining the code (read Alex for example) take that on, and should that become the case there is already a process which may or may not obsolete the integration. Don't offer or call it a patch as that is scary and some won't have shell access, but keep it much like it is today.
Sorry for the rant (and I do support <rant> </rant>)
And, btw, thanks John....
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
Do you have a smiley for a spinning head ;=}
As far as the DragMath htmlarea integration, here is what my understanding is of what has taken place:
- Alex put together a new set of xml files so that the doubledollars signs could be moved from the integration to dragmath itself, since dragmath is built to do that.
- Alex also added additional xml format files so that dragmath would do ASCIIMathML
- The files Alex built are in the DragMath CVS.
- I uploaded my proposed amendment to the dlg file to the forum, but did not put it anywhere else. I thought I saw something from someone else that indicated they were going to move that file to the Moodle DragMath Integration CVS in consort with Alex (since the change in the dlg file should be contemporaneous with any changes to the dragmath files)
- The changes I made (documented in the file I think I uploaded to the forum) basicaly did 3 things: changed the name of the function so it was not format specific, removed the insertion of the double dollar signs by the php script, and set by default the MoodleTex format (which used DragMath's <Initial> tag to insert dollar signs.)
Re: Dragmath integration - Extending functionality - files
I have uploaded the dlg_ins_smiley.php file I fiddled to go along with Alex's addition and modification of his xml export format files into CONTRIB-333 in the hope that this is what the next step was. However, as I understood the discussion in the tracker the idea was to maintain a a full integration package, so I am not quite sure whether someone offering one is expected to put together the entire zip and upload it? That should be taken care of in the CVS, no? Sorry, but I am now way more confused than John has ever been.....
Re: Dragmath integration - Extending functionality - files
Hi all,
Glen's TinyMCE is a TEST integration but it would be fantastic to get a couple of optional Equation editors to moodle.
Mathieu Petit-Clair has just started working on new core editor integration and TinyMCE, FCKEditor and Xinha are alternate editors http://tracker.moodle.org/browse/MDL-11113 for moodle 2.0. All those editors work with latest versions of Opera and Safari and adding Equation editor plugin without replacing any old plugins like smilies should be easy and special Character plugins like Enrique's "Insert Special Character" with small fix by Dean http://moodle.org/mod/forum/discuss.php?d=20864 can also be modified to new editor(s).
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
but...
I have to suggest (see my babbling post above, below or where ever of even date) that while we might reference dragmath we need to be careful about packaging something that is separate. If you want to throw a link to Alex's CVS to a dragmath that works with a specific version of the integration, well I might go that far, but as John suggests, with so much opportunity to get cross wise on versioning and no cpan like moodle utility to hunt down and reconcile versioning and dependencies as part of module installation (what a neat idea!) is this really where we should go?
and...
WIll we end up doing the same thing for each and every editor and each and every "plugin".
I like the idea of it being modular and dragmath being a plugin... I just have concerns about including the plugin in the package and the degree to which such modularization is just limited to his matter, or will be generalized across editors and plugins...
Your thoughts?
Re: Dragmath integration - Extending functionality - files
Re: Dragmath integration - Extending functionality - files
I have been playing with Xinha, TinyMCE and FCKEditor configuration for several days now and I think we can get dragmath to work as plugin with any editor. Xinha is almost like Htmlarea (they use mostly same code), Glen's tinymce Dragmath had just a small problem with path of codebase and plugins of FCKeditor are not too much different from other editors. It is also possible to rewrite htmlarea plugin - why should it take away smilies plugin?
The best situation is that we can upgrade moodle, editors and plugins separately - what ever editor we use upgrading the files of Dragmath should be easy.
Re: Dragmath integration - Extending functionality - files
- If various components of any solution are essentially being managed out of the forum it becomes an unmitigated disaster as it gets very confusing very quickly and frustrating for the user, the developer and the maintainer.
- Since we are talking about three different levels of development, if we don't have coherency then we will have things that break. For example, the Dragmath integration still includes dbldollars while DragMath has also added same. (as I understand it, Anthony's solution is not the same as John's, John's is published, and neither addresses the new version of dragmath or the changes that allow dragmath to insert the dbldollars....)
- There will arguably be a different integration for each "plugin" to each editor.
- While you are correct in stating that smilies for example can be retained, the question becomes one of managing resources and those resources include not only the time and energy to cobble the code, but the time and energy as well as to manage QA and versioning....