Implementing Marvin with WebCT?

User 111f46f5ab

18-07-2007 15:04:57

Just wondering about whether it is possible to set up MarvinSketch or other parts of the Marvin suite to run in WebCT? The native WebCT whiteboard is completely unsuitable for organic chemistry, and it would be nice if the Marvin interface could be a replacement or a supplement to the whiteboard facility.





Anybody done this?

ChemAxon 7c2d26e5cf

18-07-2007 16:35:38

Please try out MarvinChat: Chat tool based on Marvin


With the help of this tool, you (as "teacher") can share your sketcher's with others (as students). Each student sees what the teacher has drawn in his own viewer.


MarvinChat does not support two way communication (the students can not modify the teacher's structure). It is only an example. You can improve/modify it freely.

User 111f46f5ab

18-07-2007 18:17:14

MarvinChat looks a lot like what we need.





Can a text box be sent along with the image, or do you have to include text within the image itself?





I have downloaded the zip file and I'll explore this tool further. Thanx.

ChemAxon 7c2d26e5cf

23-07-2007 22:10:32

To post also textbox, the example should be modified.


The molecule should be sent in MRV format (from the teacher to the student) since MRV can store also text boxes (that are drawn to the canvas).

User 111f46f5ab

26-10-2007 16:57:43

So it seems that you can't embed Marvin into WebCT because the terms of the WebCT license (at least, the one we have) forbid any modification of the underlying Perl scripts. It is technically simple and would work if only we were permitted to make a few changes.





Anyhow, we decided to work on merging Marvin with the open-source bulletin board program phpBB (http://www.phpbb.com) and we have a prototype up and running. Anyone who is interested can have a look at http://ltc.umanitoba.ca/marvin although presently the forum will not permit anyone except us to post to it.





When we get it working smoothly and looking pretty, I will be using it in conjunction with our 2nd year organic class at The University of Manitoba.





Stay tuned...





Phil Hultin

ChemAxon 7c2d26e5cf

26-10-2007 17:10:23

Thanks for sharing your experiences.

ChemAxon 43e6884a7a

28-10-2007 20:20:35

Phil, this is really cool!

User 111f46f5ab

22-01-2008 17:27:29

We have started using Marving integrated into phpBB2 in my 2nd year introductory organic course, although students are slow to begin posting. I expect the traffic to increase in the next week as we get into things.





A problem has arisen though, which we neglected to check. We can't post a reaction with arrows, or a mechanism with electron flow arrows because the inline structures have to be passed as molfiles, which don't support this.





There must be a way to pass the information we want, since I know that ACE Organic does this. Can anyone tell me how to do this?

ChemAxon 7c2d26e5cf

23-01-2008 14:32:32

Get molecule in Marvin Document (mrv) format. It is Marvin's own format and store everything (like arrows, electron flows, etc.). There is no compressed / inline version of mrv. If you really need the molecule source in inline format, I suggest to encode it before forwarding the molecule source.


Take care that the following characters has to be encoded: " , ' , < , > , \n (end of line).


If you get the MRV source in base64 encoded format, all special characters (exclude end of line character) will be encoded: base64:mrv


After then, you have to substitute "\n" characters with a special pattern to get an inline source.


Of course, on the other side you have to decode them (insert "\n" characters to the proper places). Marvin can import base64 encoded MRV source. So after decoding of end of line characters, reading the stream into Marvin will be easy.

User 111f46f5ab

25-01-2008 16:37:51

So, if we want to embed a reaction scheme into an html forum posting, which will call the marvin applet when it is loaded, what Javascript or other scripting commands could get the marvin image as base64:mrv? When the applet is called, will it automatically read in the base64:mrv code from the html tag?





Please bear with me, my programming knowledge is sketchy but I want to be able to tell my programming guru the broad outlines of what needs to be done.





P. Hultin

User 870ab5b546

25-01-2008 19:30:35

You currently have a Javascript command that reads something like,





document.msketch.getMol("smiles");





(or "mol"). Change it to,





document.msketch.getMol("base64:mrv");

User 111f46f5ab

25-01-2008 22:05:02

Ok, that's simple enough.





In the corresponding code to read in the data, is it also necessary to specify that it is base64 encoded or will Marvin recognize this by itself?

User 870ab5b546

26-01-2008 00:30:51

You don't need to specify whether it's SMILES, MOL, or MRV, so I doubt you need to specify that it's base64 MRV.

ChemAxon 7c2d26e5cf

27-01-2008 14:54:32

To get an inline MRV from the applet:


Code:
if(document.MSketch != null) {


        var s = document.MSketch.getMol("base64:mrv");


        s = escape(s); // escaped base64:mrv string


}



Import the above result into the MarvinSketch applet:


Code:
if(document.MSketch != null) {


        var s = ...; // escaped base64:mrv string


        s = unescape(s);


        document.MSketch.setMol(s);


}



You can find the online version of the above example here: Import / export inline MRV example

User 870ab5b546

27-01-2008 15:09:35

What purpose is served by the escape() function?

ChemAxon 7c2d26e5cf

27-01-2008 16:09:30

Quote:
What purpose is served by the escape() function?
To encode "\n"-s (end of line characters). "base64:mrv" gives a multiline output. The escape method helps to convert it to a single line.





"unescape" is the inverse method of "escape".