
Atto: Chemistry editor
Edit chemistry equations in Moodle 2.7, or later, using the mhchem extension to the MathJax or TeX filter. Useful for full and ionic equations, isotopes, equilibrium reactions, thermochemistry and reaction kinetics. Includes a periodic table of element symbols.
Requirements:
1. The MathJax filter to be enabled (recommended) or the TeX filter enabled (or, in Moodle 2.8, both)
Administration > Site administration > Plugins > Filters > Manage filters
Don't forget to also enable the appropriate filter in the relevant course:
Administration > Course administration > Filters
2. The mhchem extension to be added to the MathJax configuration:
Edit Administration > Site administration > Plugins > Filters > MathJax > MathJax configuration to include:
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","mhchem.js","noErrors.js","noUndefined.js"]
},
or to the TeX filter configuration:
Edit Administration > Site administration > Plugins > Filters > Tex notation > LaTeX renderer Settings to include:
\usepackage{mhchem}
At this stage you may wish to check the filters are working by, say, typing \(\ce{ H2SO4 }\)
into Atto. This should be displayed as H2SO4 when saved.
3. The chemistry editor button (flask icon) to be added to the Atto editor toolbar:
Edit Administration > Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings > Toolbar config, to give, for example:
insert = chemistry, equation, charmap, table, clear
Immediately after installation and configuration you may need to clear your Moodle server caches:
Administration > Site administration > Development > Purge all caches
and local browser cache for correct display.
I had troubles having the button icon displayed correctly. I think that there should be a code like
iconComponent: COMPONENTNAME,
added below https://github.com/geoffrowland/moodle-editor_atto-chemistry/blob/master/yui/src/button/js/button.js#L174 as Moodle searches for the icon in the core locations without success. Also, the SVG icon provided does not seem to contain the correct icon. Rather than relying on a font, it would be better to provide plain SVG with the flask shape. Currently, it displays an U+F0C3 character for me for some reason.Other thing I noticed are empty lines at https://github.com/geoffrowland/moodle-editor_atto-chemistry/blob/master/settings.php#L301 and below. I'm not sure they are intentional and if so, why.
The rest of the code looks ok to me. With the hope the issues raised above will be addressed soon, you are cleared to land now. Welcome to the Plugins directory!
Thanks for reviewing this so quickly. As requested, I'll update the description.
I'll also work on getting the icon to display properly. Currently needs to be copied from the plugin pix/e/ location to moodle core pix/e/ folder.
The empty lines are intentional. They are required for empty buttons to act as spacers to give the periodic table layout. I'm sure this could be done more elegantly, but was a simple way to use the existing editor button layout.
Thank you very much for creating and sharing this plugin.
In similar vein, I have just released an Atto plugin for TeX/MathJax Matrices and Arrays, which I hope will prove useful.
https://moodle.org/mod/forum/discuss.php?d=320681
BTW you should fix MDL-45067, the 2x2 matrix button in the Atto Equation Editor.
Just needs \\\\ rather than \\ in the relevant line of settings.php. Presumaby an escaping issue (rendered in TeX as \\)
Do you have LaTex and other dependencies including the mhchem extension installed on your Moodle server?
Precise details vary depending on your server setup though there is more information at:
https://docs.moodle.org/31/en/Chemistry_notation_using_mhchem#via_LaTeX
Get back to me if you still have issues
Teachers on my Institution are asking for a 3.3 version...
Ricardo
I no longer have full-time involvement in education and Moodle administration/development. So, have not followed the most recent Moodle versions.
However, I'll take a look at this over the next few weeks and see if I can update for Moodle 3.3. I'm also aware that MathJax mhchem has been updated (https://mhchem.github.io/MathJax-mhchem/). So, I'll explore the implications of this too.
Cheers
Geoff
Thanks so much for the help!!!
Ricardo