Print version
  Products   wiris.com 
Products » WIRIS Quizzes


WIRIS Formula Editor
Formula and CAS plugins
WIRIS Desktop
WIRIS CAS
WIRIS Quizzes
 
WIRIS Quizzes installation

1        WIRIS Quizzes 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@mathsformore.com.

1.1      Uncompressing the package

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

1.2      Copying files

Copy all contents from wiris-quizzes/questiontypes to question/type

1.3      Editing files

1.3.1      Editing questionlib.php

Copy lib/questionlib.php file to lib/questionlib.php.old, open lib/questionlib.php and then search this string:

if ($menuname) {

Then, add after this line the next code:

/**** start WIRIS plugin ****/

if (array_key_exists($name . "wiris", $QTYPES)) continue;

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

Example:

Before:

foreach ($QTYPES as $name => $qtype) {

$menuname = $qtype->menu_name();

if ($menuname) {

$menu_options[$name] = $menuname;

}

}

After:

foreach ($QTYPES as $name => $qtype) {

$menuname = $qtype->menu_name();

if ($menuname) {

/**** start WIRIS plugin ****/

if (array_key_exists($name . "wiris", $QTYPES)) continue;

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

$menu_options[$name] = $menuname;

}

}

1.3.2      Editing question.php

Copy question/question.php file to question/question.php.old, open question/question.php and then search this string:

// Validate the question category

Then, add before this line the next code:

/**** start WIRIS Plugin ****/

if (array_key_exists($question->type . "wiris", $QTYPES))

$question->qtype = $question->qtype . "wiris";

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

Example:

Before:

// Validate the question category

if (!category = get_record(‘question_categories’, ‘id’, $question->category)) {

print_error(‘categorydoesnotexists’, ‘question’, $returnurl);

}

After:

/**** start WIRIS Plugin ****/

if (array_key_exists($question->type . "wiris", $QTYPES))

$question->qtype = $question->qtype . "wiris";

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

 

// Validate the question category

if (!category = get_record(‘question_categories’, ‘id’, $question->category)) {

print_error(‘categorydoesnotexists’, ‘question’, $returnurl);

}

1.4      Creating new tables

WIRIS Quizzes needs create some new tables on moodle’s database. If you want to create these tables automatically, open your web browser and type this link on navigation bar: http://your_server/moodle_path/wiris-quizzes/installdb.php.

1.5      Configuring WIRIS Quizzes

Now you can set WIRIS Quizzes configuration editing wiris-quizzes/wrsqz_config.php file. There is a table that specifies each parameter:

Key

Description

Default value

$CFG->wirisquizzes_serverhost

Specifies the WIRIS Quizzes remote server host.

'www.wiris.com'

$CFG->wirisquizzes_serverport

Specifies the WIRIS Quizzes remote server port.

80

$CFG->wirisquizzes_serverpath

Specifies the WIRIS Quizzes remote server path.

'/quizzes/qwirisservlet'

$CFG->wirisquizzes_extension

Specifies the WIRIS Quizzes syntax extension that uses on HTML code.

'W'

$CFG->wirisquizzes_CAScode

Specifies the default value for CAS editor.

'<session version="2.0"><library closed="false"><mtext style="color:#ffc800">variables</mtext><group><command><input><math xmlns="http://www.w3.org/1998/Math/MathML"/></input></command></group></library></session>'

$CFG->wirisquizzes_imagedir

Specifies the path relative to moodle data where images will be saved.

wiris-quizzes/imagecache

$CFG->wirisquizzes_plotborderstyle

Border style for plot images

'solid'

$CFG->wirisquizzes_plotborderwidth

Border width for plot images.

'1px'

$CFG->wirisquizzes_plotbordercolor

Border color for plot images.

'#8888ff'

$CFG->wirisquizzes_plotmargin

Margin width for plot images.

'5px'