I have updated the Jmol filter to use JSmol, as recently developed by Bob Hanson and collaborators.
In my hands, this version of the filter works with Moodle 2.3, 2.4 and 2.5 beta. Earlier Moodle 2.x versions may work, but have not been tested.
Similarly, it works with any recent browser with HTML 5 support (Firefox 20, Chrome 26, Opera 12, Internet Explorer 10 and 9 tested). Internet Explorer 8 also works, but only by defaulting to the Jmol Java applet.
Jmol/JSmol is under active development and it should be relatively straight-forward to add options for WebGL display or minimal JSmol lite display (for, say, mobile platforms).
The latest versions can be downloaded from GitHub:
The master branch is for this JSmol version for Moodle 2.x , but there are also branches for the 'old' Jmol Java applet versions for Moodle 2.x and Moodle 1.x
I'm finding that we can visualize .pdb files but not .pdb.gz files for larger protein structures. We could do that in older versions of moodle running Jmol.
.pdb.gz files should display with recent Firefox or Opera browsers, but not Internet Explorer or Chrome (not tested Safari).
The included jsmol.php file *should* allow IE and Chrome to read binary files. However, I have not yet got this working with the Moodle filter. Seems there may be complications due to folder/file hierarchies and browser/AJAX permissions. I'm still looking into this and will post a fix if/when I find one!
You can force the filter to use Java (Jmol) by changing filter.php around line 201.
By default, the filter adds hydrogens to .pdb files, on loading, by using the pdbAddHydrogens command. For consistency, this should probably happen for .pdb.gz files too.
Hope that helps.
Thanks Geoffrey! I set it up easily and it works well on my development server (moodle2.5).
Does anyone know if the JSMol filter works with Moodle 2.6?
Should work. Though I hope to release an updated version in the next few days. This will include the latest stable Jmol/JSmol 14.0.x code including the signed applet (for folks wanting the Java version with minimal security warnings), fixes to z-index (correct layering behind edit menus etc) and fixes for issues with JSmol working alongside MathJax (which now can use the mhchem extension for rendering chemical equations).
I'll post here when it's available.
We are looking to upgrade to the latest version (we are currently on the original version) along with our upgrade from moodle 2.2 to 2.6 here at the University of Nottingham.
I have had a play on my local dev environment and all looks good.
I was wondering if you still think of this as "development code" or if you think it is stable now?
University of Nottingham
In our Moodle 2.5 server Jmol is activated in any page containing LaTeX and tries to show a molecule. The LaTex generated PNG files are not displayed and we get an error message in red:
Unrecognized file format for file http://our.moodle.site.url/filtertex
<!- DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title> 404 Not Found </title>
LaTeX works fine again disabling Jmol. Is it a bug?
Our system: Ubuntu LAMP server 12.04.4 LTS (GNU/Linux 3.2.0-64-generic-pae I686). It was upgraded from 1.9 to 2.2, then 2.5. The old Jmol version was removed first and then replaced with the new one in the last step. The Ubuntu/Moodle default language is Spanish. The LaTeX filter output is configured as PNG.
I have checked the above issue on:
Moodle 2.6 (clean install)
And I cannot replicate the issue. So am a bit stumped to what the issue could be.
University of Nottingham
I have not encountered this issue either, though will investigate. May be worth checking/changing the order in which the filters are loaded.
A quick fix is to uncomment some lines towards the end of jmol/filter.php. This ensures JSmol is loaded after MathJax has completed rendering the page. Now that a MathJax filter is built into Moodle 2.7, I hope to make this simpler to configure in the next Jmol/JSmol filter release.
Did you get your question (above) answered ? We just updated to 3.1 and I want a solution to the same problem. Thanks!
Hi Christian and Ian
Apologies for not answering sooner. I had overlooked this thread.
If you add the ?i=0 parameter to the chemical structure file link, the cover image will be automatically replaced with the interactive structure.
The default of using a cover image is to speed up the loading/display of Moodle pages, particularly if multiple JSmol objects are present or if the end user is using low performance hardware/mobile devices.