Manual installation of WIRIS plugin for Moodle

DOWNLOAD

This installation should used by advanced users or if the automatic installation doesn’t work.

These instructions are also valid to perform an update.

1 Requirements

  • Moodle 1.6 or higher installed.
  • A valid license to install the plugin in a production environment; otherwise, you can use the downloaded file just for demo purposes.

2 Uncompressing the package

Unzip WIRIS Plugin package outside the moodle root directory.

3 Copy files

Copy wiris directory from pluginwiris/install/filter/ to [moodle root]/filter/.

4 Edit files

If the WIRIS plugin is already installed and you are updating it, overwrite the file [moodle root]/lib/weblib.php and name it [moodle root]/lib/weblib.php with the content of the file [moodle root]/lib/weblib.php and name it [moodle root]/lib/weblib.php.old.

If you are performing a new installation, make a copy of  the file [moodle root]/lib/weblib.php and name it [moodle root]/lib/weblib.php.old.

Open [moodle root]/lib/weblib.php and make two changes; one is common, and the other is version dependent.

4.0 Common change

Search this string:

echo print_editor_config($editorhidebuttons);

 

Then, add after this line the next code:

/**** begin WIRIS Plugin ****/
echo "\nWiris.register(config);\n";
/**** end WIRIS Plugin ****/

 

Example:

Before:

echo print_editor_config($editorhidebuttons);

if (empty($name)) {

After:

echo print_editor_config($editorhidebuttons);

/**** begin WIRIS Plugin ****/
echo "\nWiris.register(config);\n";
/**** end WIRIS Plugin ****/

if (empty($name)) {

4.1 On moodle 1.6 and 1.7

Now search this string:

$scriptcount++;

Then, add before this line the next code:

/**** start WIRIS plugin ****/
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="' . $CFG->wwwroot . '/filter/wiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';
/**** end WIRIS Plugin ****/

Example:

Before:

$str .= ($scriptcount < 1) ? '<script type="text/javascript src="' . $CFG->wwwroot . '/lib/editor/htmlarea/lang/en.php"></script>' . "\n" : '';
$scriptcount++;

After:

$str .= ($scriptcount < 1) ? '<script type="text/javascript src="' . $CFG->wwwroot . '/lib/editor/htmlarea/lang/en.php"></script>' . "\n" : '';

/**** start WIRIS plugin ****/
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="' . $CFG->wwwroot . '/filter/wiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';
/**** end WIRIS Plugin ****/

$scriptcount++;

4.2 On moodle 1.8 or higher

Now search this string:

$scriptcount++;

Then, add before this line the next code:

/**** start WIRIS plugin ****/
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="' . $CFG->httpswwwroot . '/filter/wiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';
/**** end WIRIS Plugin ****/

Example:

Before:

$str .= ($scriptcount < 1) ? '<script type=”text/javascript src="' . $CFG->httpswwwroot. '/lib/editor/htmlarea/lang/en.php"></script>' . "\n" : '';
$scriptcount++;

After:

$str .= ($scriptcount < 1) ? '<script type=”text/javascript src="' . $CFG->httpswwwroot. '/lib/editor/htmlarea/lang/en.php"></script>' . "\n" : '';

/**** start WIRIS plugin ****/
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="' . $CFG->httpswwwroot. '/filter/wiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';
/**** end WIRIS Plugin ****/

$scriptcount++;

5 Activate the filter

5.1 On moodle 1.6

On moodle administration block, click on “Configuration”. Then, click on “Filters”. Finally, activate “Wiris” filter as this image:

5.2 On moodle 1.7 or higher

On moodle administration block, click on “Modules” >> “Filters”. Then, activate “Wiris” filter as this image:

6 Configure WIRIS Plugin

Now you can enable or disable WIRIS editor and WIRIS cas from the "Settings" page of the WIRIS plugin.

Also, you can set WIRIS Plugin configuration editing [moodle root]/filter/wiris/wrs_config.php file. This table specifies each parameter:

 Key  Description  Default value  Possible values 
$CFG->wirisservicehost(1)Host of the application server.'services.wiris.com' 
$CFG->wirisserviceportPort of the application server.80 
$CFG->wirisservicepathContext root of the application server.'/demo/formula' 
$CFG->wirisserviceversionVersion of the application server.'2.0''1.0', '2.0'
$CFG->wirisimagebgcolorBackground formula color.'#fafafa' 
$CFG->wiristransparencySets transparent background for the formulas (avaible for Mozilla / IE 7 or higher).'true''true', 'false'
$CFG->wirisimagefontsizeFormulas font size.'16' 
$CFG->wirisformulaeditorenabledEnable the insertion of formulas using WIRIS Formula Editor.truetrue, false
$CFG->wiriseditorarchiveSpecifies the WIRIS Formula Editor jar file.'wiriseditor.jar' 
$CFG->wiriseditorclassSpecifies the WIRIS Formula Editor main class.'WirisFormulaEditor' 
$CFG->wiriscasenabledEnable the insertion of WIRIS cas applet in the HTML editor.truetrue, false
$CFG->wiriscascodebase(1)WIRIS cas codebase.'http://www.wiris.net/demo/wiris/wiris-codebase/' 
$CFG->wiriscasarchive(1)WIRIS cas jar file.'wrs_XX_en.jar' 
$CFG->wiriscasclass(1)WIRIS cas main class.'WirisApplet_XX_en' 
$CFG->wiriscaslang

Available languages (depending on your WIRIS cas installation).

arArabicالعربية
caCatalanCatalà
deGermanDeutsch
esSpanishEspañol
etEstonianEesti
enEnglishEnglish
euBasqueEuskara
frFrenchFrançais
itItalianItaliano
nlDutchNederlands
ptPortuguesePortuguês
'en,es,fr,it,nl,et,ca,eu,pt,de'Any subset of the default value.
$CFG->wirisfilterdirSpecifies where is the WIRIS Plugin filter directory.'filter/wiris' 
$CFG->wirisimagedirSpecifies where the formulas will be created.'filter/wiris' 
$CFG->wirisformulaimageclassSpecifies the class attribute for image formulas.'Wirisformula' 
$CFG->wiriscasimageclassSpecifies the class attribute for CAS objects.'Wiriscas' 
$CFG->wirisproxySpecifies if the server should use a proxy connection.falsetrue, false
$CFG->wirisproxy_hostSpecifies the proxy host.  
$CFG->wirisproxy_portSpecifies the proxy port.  
$CFG->wirisproxy_userProxy user name.  
$CFG->wirisproxy_passwordProxy password.  
$CFG->wirisPHP4compatibilitySet it “true” if you are using PHP 4. This attribute disables proxy connections. If you want to use a proxy connection, use PHP 5.truetrue, false

(1)The WIRIS plugin needs to access an external server to get additional resources (formula editor applet, image service and WIRIS cas). See architecture for more information. The default configuration connects to de demonstration services at www.wiris.net/demo/ . It is possible to install all necessary services in the customer server (not only the plugin).

7 Clean data

If you want to free your disk space, you can empty the cache directory (remember: don’t delete the directory, only remove its contents). The path to that directory is [moodle data]/filter/wiris

This directory will be repopulated when users view the formulas.