plug-ins?

plug-ins?

by Gustav W Delius -
Number of replies: 6
Moodle already allows plug-ins (modules) for Resources and for Authentication. I would like to suggest something similar for Moodle's output.

The output routines in lib/weblib.php should pass their output through the plug-ins, if they exist. These plug-ins could then parse the output and make conversions. I have the following applications in mind:

1) a Glossary/Dictionary that scans the output for words for which it has definitions and automatically links them to the entries.

2) Mathematics: we mathematicians like to use a specialized syntax (TeX) for writing formulas. The plugin would convert this mark-up to MathML for display in the browser.

Can anyone else think of a reason why they might want Moodle to give them the possibility to parse through the output before it reaches the page?
Average of ratings: -
In reply to Gustav W Delius

Text filters

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ah! smile I was thinking the EXACT same thought just two hours ago. smile Social constructionism in action!

Actually, there is already a hook in place for the library add-on - it's simply a matter of expanding the concept to make it support arbitrary numbers of plugins efficently. The existing text filtering that happens (eg text-to-html, wiki-to-html etc) can also be integrated into the same pipeline as standard modules.

This is a must-have improvement in my view. I'd like to see a filter for linking to resources, user names etc, and maybe one day a language-translation plugin.
In reply to Martin Dougiamas

Re: Text filters

by Gustav W Delius -
We may have been thinking along the same lines but you have been much better in putting it into words. Yes, text filters is what I mean.

What I am not so clear about in my head is how to daisy-chain the various filters? So for example I may want my forum posts to go through BOTH the text-to-html filter AND the mathematics filter. But of course I don't want them to go through both the text-to-html and the wiki-to-html filter.
In reply to Gustav W Delius

Re: plug-ins?

by Andrew R -
Any XML content. It could be transformed using XSL(esp. XSL FO). Useful for people who want thier data to be organized in different ways.
In reply to Andrew R

Re: plug-ins?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Andrew, are you suggesting that people would type XML directly into forums etc? Can you please give an example of how this would be useful for "data to be organized in different ways"?

I know about XSL, I'm just having trouble thinking of a practical use for it in this case.
In reply to Martin Dougiamas

Re: plug-ins?

by Ger Tielemans -

In a demo tool called Toot-O-Matic (with limited functionality ) created by IBM , you have to create the pages with pictures in an XML-tree. I show teachers the working demo in this order:

  • Visit first the created webpages on a webserver
  • then show them that the same pages are stored under a button on the HTML-pages as PDF
  • also show that the set of HTML-pages is stored as a ZIP under another button
  • then show them the XML-tree and point to the structure they saw on the website
  • then change for example the name of the author (the demo has bugs like line max=80)
  • then recompile...
  • SHOW that all the resources: the HTML, the PDF and the set in the ZIP are changed!!

For the first time they undestand how powerfull XML can become for education

Old review of TOM:

http://www.techwr-l.com/techwhirl/archives/0110/techwhirl-0110-01594.html

The IBM resource:

http://www-106.ibm.com/developerworks/xml/library/x-toot/index.html

The next step is a matter of giving up flexibilty: If you accept that a resource could have a preformatted book-a-like structure, you could place a set of fill-in pages on top of this kind of toot-o-matic idea and then generate a PDF, together with a set of HTML files, all together stored in a zip file and easy to upload and unzip in the resources area

Would be nice to fill these pages and then let Moodle put all the parts on the right place..