Adding Chemistry editor to Atto

It is very easy to add a chemistry editor plugin to the Atto editor. There are 2 apects to this:

  1. Adding the capability to render chemical equations
  2. An editor capable of making this rendering accessible to user without remembering intricate syntax

The 1st item is easily taken care of by enabling additional capabilities of the MathJax filter by enabling TeX extension: ‘mhchem.js’ We will do this later. The 2nd item needs the addition of a new plugin to the Atto editor called chemistry.

To add the plugin, we need to clone a repository that carries the code.

cd /path-to-moodle/lib/editor/atto/plugin

sudo git clone chemistry

Let Moodle install this plugin by discovery. There are a few configuration settings to change.

Go to Site->plugins->filters->mathjax and edit the configuration settings to look as follows:

config: [“Accessible.js”, “Safe.js”],
TeX: { extensions: [“AMSmath.js”,”AMSsymbols.js”,”color.js”,”mhchem.js”,”noErrors.js”,”noUndefined.js”] },
errorSettings: { message: [“!”] },
skipStartupTypeset: true,
messageStyle: “none”

Finally, Site administration > Plugins > Text editors > Atto HTML editor > Atto toolbar settings > Toolbar config, to look like:

insert = chemistry, equation, charmap, table, clear

Purge all caches if necessary. That’s it, you have access to the Chemistry editor in Atto.

Even though this plugin claims to work only up to Moodle 2.8 I have tested this on Moodle 3.6.1 and it seems to work fine.

Posted in moodle, plugin, Uncategorized and tagged , .