Print version
  Products   wiris.com 
Products » Formula and CAS plugins » Moodle plugin


WIRIS Formula Editor
Formula and CAS plugins
WIRIS Desktop
WIRIS CAS
WIRIS Quizzes
 
WIRIS Plugin for moodle installation

1        WIRIS Plugin for moodle installation

1.1      About this installation

This installation is not recommended, and you should use this guide if quick installation doesn’t work. If you have any problem, you can send an e-mail to info@wiris.com.

1.1      Uncompressing the package

Download WIRIS Plugin and unzip it on your moodle’s root directory.

1.2      Copying files

Copy wiris directory from pluginwiris/install/filter/ to filter/.

1.3      Editing files

Copy lib/weblib.php file to lib/weblib.php.old, open lib/weblib.php and 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)) {

1.3.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 . '/pluginwiris/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 . '/pluginwiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';

/**** end WIRIS Plugin ****/

 

$scriptcount++;

1.3.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 . '/pluginwiris/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. '/pluginwiris/editor/wrs_plugin.js.php"></script>' . "\n" : '';

/**** end WIRIS Plugin ****/

 

$scriptcount++;

1.4      Activating the filter

1.4.1      On moodle 1.6

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

1.4.2      On moodle 1.7 or higher

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

1.5      Configuring WIRIS Plugin

Now you can set WIRIS Plugin configuration editing pluginwiris /wrs_config.php file. There is a table that specifies each parameter:

Key

Description

Default value

$CFG->wirisservicehost(1)

Host of the application server.

'services.wiris.com'

$CFG->wirisserviceport

Port of the application server.

80

$CFG->wirisservicepath

Context root of the application server.

'/formula'

$CFG->wirisimagebgcolor

Background formula colours.

'#fafafa'

$CFG->wiristransparency

Sets transparent background for the formulas (avaible for Mozilla / IE 7 or higher).

'false'

$CFG->wirisimagefontsize

Formulas font size.

'16'

$CFG->wirisformulaeditorenabled

Enable the insertion of formulas using WIRIS Formula Editor

true

$CFG->wiriseditorarchive

Specifies the WIRIS Formula Editor jar file.

'wiriseditor.jar'

$CFG->wiriseditorclass

Specifies the WIRIS Formula Editor main class.

'WirisFormulaEditor'

$CFG->wiriscasenabled

Enable the insertion of WIRIS CAS applet in the HTML editor.

true

$CFG->wiriscascodebase(1)

WIRIS CAS codebase.

'http://XXXXX/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).

'en,es,fr,it,nl,et,ca,eu,pt,de'

$CFG->wirisfilterdir

Specifies where is the WIRIS Plugin filter directory.

'filter/wiris'

$CFG->wirisimagedir

Specifies where the formulas will be created.

'filter/wiris'

$CFG->wirisformulaimageclass

Specifies the class attribute for image formulas.

'Wirisformula'

$CFG->wiriscasimageclass

Specifies the class attribute for CAS objects.

'Wiriscas'

$CFG->wirisproxy

Specifies if the server should use a proxy connection.

false

$CFG->wirisproxy_host

Specifies the proxy host.

 

$CFG->wirisproxy_port

Specifies the proxy port.

 

$CFG->wirisPHP4compatibility

Set it “true” if you are using PHP 4. This attribute disables proxy connections. If you want to use a proxy connection, use PHP 5.

true

(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 services.wiris.com to get such services. However, you might consider acquiring a production access. Under certain circumstances it is possible to install all necessary services in the customer server (not only the plugin).