DragMath and Chat

DragMath and Chat

by anthony danese -
Number of replies: 13

Is it possible to add buttons to the chat window, specifically the DragMath button?  If so, how can this be done?

Best,

agd

Average of ratings: -
In reply to anthony danese

Re: DragMath and Chat

by Marc Grober -
Yes this could probably be done, but to what end? Remember that dragmath is not a display technology.

On the otherhand, assuming you want students to be able to do math notation in a chat environment, I believe Dave chapman has done an example of this with asciimath that I could run down for you.
In reply to Marc Grober

Re: DragMath and Chat

by anthony danese -

Hi Marc,

Thanks for the reply.  Yes, I realize it's not a display technology, but I'd like to give students the ability to generate a mathematical expression's corresponding latex so they can "easily" enter complex mathematical notation when chatting.  This ability would be useful for some of my physics classes and I know it would be most useful for the mathematics teachers at my school.

I will search for this information about asciimath (and post back here if I find it), but if you run across it first, I'd greatly appreciate the information.

Again, thank you.

In reply to anthony danese

Re: DragMath and Chat

by Mauno Korpelainen -

If you want to use default editor, HTMLArea with latest Dragmath installed to your site you need to modify two files (index.php and chatinput.php) in folder mod/chat/gui_header_js that replace input field with textarea that moodle can replace with editor using functions print_textarea and use_html_editor (you can also select which buttons you want to hide from editor)

Check those files from attached zip file (I tested this quickly so code may not be optimal...)

In reply to Mauno Korpelainen

Re: DragMath and Chat

by Mauno Korpelainen -

And it looks like this with tex filter enabled:

(you could also replace selected textarea with tinymce and in fact with one button in toolbar but I suppose you want to use HTMLArea here...) 

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: DragMath and Chat

by anthony danese -

Marc and Mauno,

Thank you so much.  I replaced the index.php and chatinput.php files and it works like a charm!

Best,

agd

In reply to anthony danese

Re: DragMath and Chat

by Marc Grober -
Remember, chat is easily overwhelmed and will change come moodle 2 (as will the editor as htmlarea is headed for obscurity Moodle-wise).

The math chat I was talking about earlier created by David Lipmann (sorry, Chapman is NOT his last name....) can be founf here:
http://www.imathas.com/cur/mathchat/testchat.html
I am pretty sure this uRL is NOT meant to be used as a production application, but just shows what can be done (this is a part of what David has created as iMathAS)

If you would like, Anthony, add a section to the dragmatjh docs under developments and document this extended functionality.....

You might want to also suggest that chat for Moodle 2 include such options both via discussion in the forums and the creation of a tracker item.
In reply to Marc Grober

Re: DragMath and Chat

by anthony danese -

Hi Marc,

Thanks for the Lipmann link--very nice.  That is ideally what I would love to see in a math chat application. 

I am very new to Moodle, but it is growing on me.  I feel that more math/physics teachers (where I am at least) would warm up to Moodle too if Moodle's mathematical functionality were expanded.

When you say, 'add a section to the dragmath docs under developments', do you mean http://docs.moodle.org/en/Talk:DragMath_equation_editor?

I will add mention of this discussion in the forum you link to at the bottom of the above link and also create a tracker when I can.

Thanks again.

agd

In reply to anthony danese

Re: DragMath and Chat

by Marc Grober -
Saw you playing with David's app.... this is relatively easy to do with asciimath, and if you check pout the SEE thread in the math forum you will find links to Mauno test site where he is exploring plugins to make tinyMCE amenable to math and science instruction.

If there is enough interest it would not be a major challenge to incorporate David's Math chat in a Moodle. If you want to pursue same let me know and I will attempt to facilitate that.

As far as docs, add a section here:
http://docs.moodle.org/en/DragMath_equation_editor#Development
In reply to Marc Grober

Re: DragMath and Chat

by Mauno Korpelainen -
It can be done...

All we need to do is to replace the same textarea that I used in previous code with tinymce (not HTMLArea) and we need to have TinyMCE (latest release) together with asciisvg and asciimath plugins (both are open source, ready for use and available) and we need to add init code for those plugins either to theme files or to chat module itself (if we add a file javascript.php to folder mod/chat moodle (lib/javascript-mod.php) will read it automatically like it does for old asciimath filter (the reason why it can't be disabled)

It's a little more complex than this htmlarea example but can be done both in moodle 1.9 and in moodle 2.0 with new code.

Marc, I found some days ago a nice way to create a browser selective asciimath filter that allows rendering tex (or image fallback) with tex filter and asciimath as MathML for Firefox and asciisvg with fallback script for each browser separately - idea works but needs just some rewriting of code. I am still thinking of using administration (settings) of this new filter to allow modifying main settings from administration menu instead of the actual script.
In reply to Marc Grober

Re: DragMath and Chat

by anthony danese -

Marc and Mauno,

Yes, I'm very interested in seeing the math features of David's app incorporated into Moodle chat.  I would be willing to help out in whatever capacity I'm able.

I've come across discussions about tinyMCE vs. htmlArea.  Would you recommend that I switch over to tinyMCE?

Thanks.

anthony

In reply to anthony danese

Re: DragMath and Chat

by Mauno Korpelainen -

In moodle 1.9 no current integration of TinyMCE is fully functional but we have plenty of choices here. It is possible to use tinymce for example in some particular theme so that you disable default editor first (for example in theme config.php) and then use a certain class to render tinymce only for that class (textarea). But we can use the same idea in this particular module or in a clone of chat module (let's say "tinychat" or "mathchat") so that we don't need to modify the core code of moodle at all. In moodle 2.0 it will be possible to use default editor directly with some extra code or for example to use another parallel version of tinymce ("advanced math editor") again without modifying the core code.

This MathChat was a good, new idea - I saw the original post from David Lippman in google group for asciimath when David posted it but never thought we could actually use the idea in chat module of moodle as well.

Do you think it's better to create a new MathChat module with TinyMCE or to modify current code of chat module?

In reply to Mauno Korpelainen

Re: DragMath and Chat

by Marc Grober -

Mauno,

Remember that for many the current chat is virtually unusable, hence focusing additional energy on it was dubious when it was going to be replaced (cf. Erfurtwiki and nwiki dev) - I've suggested davids solution to a few who wanted to look at such options outside of moodle chat, and would hope that as discussion of chat on M2 becomes broad enough to include entire community that points below will be kept in mind.

I think that in moodle 2 tinyMCE w plugin options should be available in all instances of text input globally ;)

I think extensive additional dev for 1.9 would be like a black hole unless the work was applicable to 2.0, so I would go with KISS

David is an old moodle hand and I think it might simpler in the short run to look at using his mathchat as opposed to cobbling up other solutions beyond simply invoking asciimathml
In reply to Mauno Korpelainen

Re: DragMath and Chat

by Jonathan Castillo -
I used the attached qui_header_js.zip file and it's working fine except for a small glitch (I guess), the text area does not clear when sending a message. Any hint how to clear the text area after clicking the send button?