Manual installation

Remember that this installation procedure is only intended for system administrators with particular needs, or in case the automatic installation has failed.

Follow these instructions:

  1. Unzip wiris-quizzes-x.x.x.xx.zip in the root directory of Moodle. The folder wiris-quizzes will be created.
  2. Copy the following folders:
    • From wiris-quizzes/questiontypes to question/type. There are 6 folders which contain the new question types used by WIRIS Quizzes, which will be added to Moodle’s question types.
  3. Edit the following Moodle files:
    1. lib/questionlib.php
      1. Make a copy of this file; copy lib/questionlib.php to lib/questionlib.php.old . The name of the backup file is important because it could be used in case of update or uninstallation.
      2. Open lib/questionlib.php with a plain text editor.
      3. Search for the following string in the text:
        if ($menuname) {
        
      4. Add, immediately after this line, the following three lines:

        /**** start WIRIS plugin ****/
        if (array_key_exists($name . "wiris", $QTYPES)) continue;
        /**** end WIRIS Plugin ****/
        
        
      5. Hence, this fragment of file will look like this:

        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;
            }
        }
        
    2. question/question.php
      1. Just as before, make a copy of this file and call it question/question.php.old .
      2. Open question/question.php with a plain text editor.
      3. Search for the following line in the text:
        // Validate the question category.
        
      4. Add, immediately before this line, the following four lines:
        /**** begin WIRIS Plugin ****/
        if (array_key_exists($question->qtype . 'wiris', $QTYPES))
        $question->qtype = $question->qtype . 'wiris';
        /**** end WIRIS Plugin ****/
        
      5. Hence, this fragment of file will look like this:
        print_error('notenoughdatatoeditaquestion', 'question', $returnurl);
        }
        
        /**** begin WIRIS Plugin ****/
        if (array_key_exists($question->qtype . 'wiris', $QTYPES))
        $question->qtype = $question->qtype . 'wiris';
        /**** end WIRIS Plugin ****/
        
        // Validate the question category.
        if (!$category = get_record('question_categories', 'id', $question->category)) {
        
  4. Configure Quizzes by editing its configuration file:
    1. Find the configuration file of Quizzes: wiris-quizzes/wrsqz_config.php .
    2. Make a copy of this file, and call it wiris-quizzes/wrsqz_config.php.old .
    3. Open wiris-quizzes/wrsqz_config.php with a plain text editor. It will have the following content:
      <?php
      global $CFG;
      
      $CFG->wirisquizzes_serverhost='services.wiris.com';
      $CFG->wirisquizzes_serverport='80';
      $CFG->wirisquizzes_serverpath='/quizzes/qwirisservlet';
      
      $CFG->wirisquizzes_imagedir = 'wiris-quizzes/imagecache';
      
      //Plot images style options.
      $CFG->wirisquizzes_plotborderstyle = 'solid';
      $CFG->wirisquizzes_plotborderwidth = '1px';
      $CFG->wirisquizzes_plotbordercolor = '#8888ff';
      $CFG->wirisquizzes_plotmargin = '5px';
      ?>
      
    4. Each line with the form:
      $CFG->wirisquizzes_xxx = yyy;

      is the definition of a configuration parameter of Quizzes. In most cases, and especially in test or demo installations, you will not have to change any of these parameters. In a production environment, however, it is very likely that you will have to modify the first three parameters, related to the WIRIS Quizzes remote server (see Which WIRIS Quizzes service server must be selected?). Next we explain the meaning of each parameter.

      ParameterDescription
      $CFG->wirisquizzes_serverhostThe address of the remote web server where it has been installed the WIRIS Quizzes service. By default, 'services.wiris.com'
      $CFG->wirisquizzes_serverportThe port where the WIRIS Quizzes is found in the above server. By default, '80'.
      $CFG->wirisquizzes_serverpathThe route, relative to the server address, in which the WIRIS Quizes server can be found. For instance, if the service is at http://services.wiris.com/quizzes/qwirisservlet, this property should be '/quizzes/qwirisservlet'. Usually this parameter will not have to modified.
      $CFG->wirisquizzes_imagedirThe folder, relative to the Moodle data folder (usually moodledata), where images generated by Quizzes are stored. Don’t get this mixed with the folder where the WIRIS Plugin stores formulae images, although they can be the same. By default, 'wiris-quizzes/imagecache'.
      $CFG->wirisquizzes_plotborderstyleThe style of the border used for the images of graphics generated by Quizzes. The syntax is that of CSS stylesheets. By default, 'solid'.
      $CFG->wirisquizzes_plotborderwidthThe width of the border used for the images of graphics generated by Quizzes. The syntax is that of CSS stylesheets. By default, '1px'.
      $CFG->wirisquizzes_plotbordercolorThe color of the border used for the images of graphics generated by Quizzes. The syntax is that of CSS stylesheets. By default, '#8888ff'.
      $CFG->wirisquizzes_plotmarginThe margin used for the images of graphics generated by Quizzes. The syntax is that of CSS stylesheets. For example, '5px'.

       
  5. Create the tables needed for Quizzes in Moodle’s database. Except in very unusual cases, this process can be done automatically. Just open your browser and write this address in the navigation bar: http://<your_moodle>/wiris-quizzes/installdb.php . In case an error happens, you can find the database specification in Moodle XMLDB format at wiris-quizzes/install/db/install.xml. Vea Which tables does WIRIS Quizzes create in Moodle’s database? y How to create manually the tables WIRIS Quizzes needs? in case you need it.