Atto Editor Word import plugin

Atto Editor Word import plugin

by Eoin Campbell -
Number of replies: 6
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I recently released a new Atto editor plugin which allows you import Word content into any textbox in Moodle, see https://moodle.org/plugins/view/atto_wordimport. It delivers much better results than copying and pasting Word content into text fields.  

The main features are as follows.

  • It imports quite clean XHTML without all the crud usually associated with pasting content from Word.
  • It imports any images embedded in the Word file (as long as they are Internet-compatible, i.e. GIF/PNG/JPEG, but not BMP or EPS).
  • It converts Microsoft Equation Editor equations into MathML and imports the MathML in a way that is compatible with MathJax.
  • It imports tables, retaining merged rows and cells, but not table borders (at present).
  • It imports the Word heading styles (Heading 1, Heading 2, etc.) into XHTML heading elements (e.g. h3, h4), and allows you specify a mapping between the heading style and the preferred element.

It's just an initial release, and so may not be suitable for production servers, but it is based on a much more mature plugin (WordTable, for importing quiz questions from Word), so I think it is worth a look nonetheless. Any feedback appreciated.


Average of ratings: -
In reply to Eoin Campbell

Re: Atto Editor Word import plugin

by Karl Randau -

Hi Eoin,

Your plugin is exactly what I need unfortunately it doesn't work! When I copy paste into the initial window the formatting looks great but then when I insert it some formatting is lost, especially font sizes etc on the titles. 


Do you have any idea how to solve this? 


Thanks

Kalle

In reply to Karl Randau

Re: Atto Editor Word import plugin

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The plugin ignores specific formatting such as font sizes and colours. It only maps predefined Word style names to HTML element names, for example the "List Bullet" style is converted to the li element. Well-structured and styled Word documents convert quite well into HTML, but documents with a lot of font-size changes, colours, etc. don't convert so well, although at least the result is quite clean HTML, but probably not what you had hoped for.

A workaround for this issue would be to define named styles in Word to represent the specific formatting you would like, so if you want bold red text, define a character style called "BoldRed". The conversion process should convert this to something like <span class="BoldRed">text</span>. You can then create a CSS style in your theme to make the text appear how you want: ".BoldRed { font-weight: bold; color: red}".

In reply to Karl Randau

Re: Atto Editor Word import plugin

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Kalle,

I think you have to upload the entire DOCX file using the new Word Import Button.  The button should be in the editor.  When you click it you are presented with the file manager window.  Upload or pick your file to import.  

We just started testing this and it works great with the first couple of documents I tried.  

In reply to Chris Kenniburg

Re: Atto Editor Word import plugin

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Chris,

Just saw your nice video on YouTube. It gets a mention on MoodleNews too. Many thanks.


I didn't even realise it would import Google Docs files too!

You might also be interested in my similar Word import plugin for Moodle Books, which does the same thing as for Atto, but splits Word files into chapters and subchapters as it imports them. It can also export books back out into Word, after a fashion.

Average of ratings: Useful (4)
In reply to Eoin Campbell

Re: Atto Editor Word import plugin

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Eoln

Do you think, you can extend your plug-in to handle ODT too?
In reply to Visvanath Ratnaweera

Re: Atto Editor Word import plugin

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Visvanath,
It is technically feasible to support ODT, but quite a big job, so it's unlikely to happen any time soon.
However, LibreOffice 4/5 can save ODT files to Word 2010 .docx format, which should import reasonably well.
As far as I can tell, OpenOffice doesn't offer the same facility to save to Word 2010 format, so you're out of luck there.

I only recently started using LibreOffice, and I haven't done much testing of how well the plugin imports .docx files saved from LibreOffice, but I believe that headings, embedded images, character-level formatting and tables should all import OK. I think numbered and bulleted lists won't import very well, as the import depends on style names like "List Bullet" and "List Number" (the built-in Word styles) to work properly. LibreOffice doesn't have these named styles, so lists will import as plain paragraphs, I think.