An early patch to add spell checking to the HTML editor

An early patch to add spell checking to the HTML editor

by Ludo (Marc Alier) -
Number of replies: 4

Hello,

here is an early patch to add a spell checking feature to the moodle's HTML editor.

Current Features:

  • Add's a button in the HTML editor toolbar that invoques a spell checking utility.
  • Only one language

Future work (but I'm gonna need some help):

  • Multiple languages ( as many as dictionaries installed on the server )
  • Binding the dictionary language with the course language or user's language.
  • Activate / deactivate the tool depending on the course and/or  user profile.

Installation instructions.

  1. Download and Install the ASPELL application from the following addresses:
    http://aspell.net/win32/ If you work with windows.
    http://aspell.sourceforge.net If you prefer the UNIX version.
    I use the version 5 (because is more stable and has more dictionaries available).
  2. Download and Install the English dictionary.
  3. The file speller.zip contains a directory called "speller" that must be unzipped into the
    moodle directory.
  4. Edit the file speller/server-scripts/spellchecker.php and:
    #  Change the aspell_prog variable to point to the aspell.exe file
    # in your system
    # is VERY IMPORTANT that you leave the double cuotes insithe the simple ones
    # like this $aspell_prog = '"c:\usr\Aspell\bin\aspell.exe"';
  5. Replace The File "weblib.php" in the "lib" directory. ( But make a backup first tímido )

Now you only have to access to your moodle site and use the HTML editor to post something. You'll find a new button.

Good luck.

Marc

Average of ratings: -
In reply to Ludo (Marc Alier)

Re: An early patch to add spell checking to the HTML editor

by Michael Penney -

Great stuff!

The only problem I had was with custom lang files, got a 'call to undefined function moodle_setlocale() on line 976' in weblib on several courses with force language on (to a custom lang file). Commenting that line out fixed the problem and the spellchecker still works.

I do notice that it shows all the html in the page, and so you have to 'ignore' your img, br,etc. Is there a way to have it ignore html?

In reply to Michael Penney

Re: An early patch to add spell checking to the HTML editor

by Ludo (Marc Alier) -

Hi Michael,

I think that the error with moodle_setlocale will be fixed during the development of the
multilanguage feature.

To bypass the HTML we should create a word list with trhe HTML tags to make ASPELL believe that HTML tags are well spelled words. I'll post instructions about soon.

Marc

In reply to Ludo (Marc Alier)

Re: An early patch to add spell checking to the HTML editor

by W Page -
Hi Marc,

The two threads about the speller you are working on should be "split" over to the
"HTML Editor" forum.
http://moodle.org/mod/forum/view.php?f=224

Janne Mikkonen is the "HTML Editor Guru" at Moodle. I am sure he will appreciate your contribution.

Can you create/make up a test site. I downloaded the additional files from SourceForge but I cannot understand the instructions as to how to install that part of the process.

Your instructions are OK but this business about C++ and compilation is making my head spin. I do have SSH but I am no SSH wizard. If you can break down the instructions more then they have them, that might be helpful.

This looks like a really neat addition to Moodle.

WP1

 

In reply to W Page

Re: An early patch to add spell checking to the HTML editor

by Ludo (Marc Alier) -
  • Hi WP1,

I'll post rigth now a message with all this stuff to the HTML Editor thread.

About the C++ compilation: I use ASPELL on windows XP and I did install the binaty version wich you can dowloada here:

Latest Version: GNU Aspell-0.50.3 (win32)

Full installer (Released Dec 22, 2002)

And the precompiled English dictionary is here

English aspell-en-0.50-2-3.exe 2.3 M Kevin Atkinson

(both links taken from http://aspell.net/win32)

If you work with linux or another unix OS:

Aspell is here: Latest Version: GNU Aspell 0.50.5 (Released Feb, 2004)

I've been reading the UNIX  Installation instructions
(http://aspell.net/man-html/2_Getting.html#SECTION00350000000000000000
and this C++ static variables business beats me. I'm sorry. Can anybody help? 

Marc