Instructions for Integrating NanoGong in Moodle 2

This page is intended for administrators (the people who do the installing or updating). If you are a teacher or student (that is, you only use the system, and not install things on it), you can ignore this page.

These are the instructions for integrating NanoGong in Moodle 2. You should already have a working version of Moodle installed.

Page contents

Installing NanoGong in Moodle 2

  1. Installing the NanoGong Activity Module
  2. Installing the NanoGong Plugin for the HTML Editor (TinyMCE)
 

Installing NanoGong in Moodle 2

To better illustrate the process a video has been created to show the installation of the NanoGong activity module and the NanoGong plugin for the HTML editor in Moodle 2.

The NanoGong packages used in the video can be downloaded from the downloads page after submitting a request form.

In addition to the video you can also read the installation instructions in the following sections.

1. Installing the NanoGong Activity Module in Moodle 2

This stage explains the installation of the NanoGong activity module. If you only want to install the NanoGong plugin for the HTML editor (TinyMCE) you can skip to stage 2.

 
Step 1.1 DOWNLOAD NANOGONG ACTIVITY MODULE
  • Download the NanoGong activity module from the downloads page after submitting a request form
 
Step 1.2 EXTRACT THE FILES
  • You will see that one directory (nanogong) and a couple of files in the zip file
  • Extract the directory nanogong to the directory moodle/mod/ to create moodle/mod/nanogong
 
Step 1.3 INSTALL NANOGONG ACTIVITY MODULE IN MOODLE
  • Log on Moodle as admin, and go to Home
  • It will show the 'Plugins check' page automatically, then click the 'Upgrade' button
  • The NanoGong activity module will be automatically installed and you will receive a message saying that the module was installed as shown in the image below
The resulting screen display
The Message Indicating Successful NanoGong Activity Module Installation
(click to enlarge image)
 

2. Installing the NanoGong Plugin for the HTML Editor (TinyMCE) in Moodle 2

This stage explains the installation of the NanoGong plugin for the HTML Editor (called TinyMCE) in Moodle 2. If you only want to install the NanoGong activity module you can skip this stage.

 
Step 2.1 DOWNLOAD THE NANOGONG PLUGIN
  • Download the NanoGong plugin for the HTML editor from the downloads page after submitting a request form (you probably already did this in step 1.1 above)
 
Step 2.2 EXTRACT THE FILES
  • You will see two directories (filter and plugin) and a couple of files in the zip file
  • Extract the directory filter/nanogong to the directory moodle/filter/ to create moodle/filter/nanogong
  • Extract the directory plugin/nanogong to the directory moodle/lib/editor/tinymce/tiny_mce/*.*.*/plugins/ to create moodle/lib/editor/tinymce/tiny_mce/*.*.*/plugins/nanogong
    (Note that *.*.* is the version number of the TinyMCE editor, which may not be the same for different Moodle 2 installations)
 
Step 2.3 ADD THE NANOGONG PLUGIN TO THE HTML EDITOR
  • Edit the file lib.php under the directory moodle/lib/editor/tinymce/
  • Near the end of the get_init_params() function, you will see this line of code:
    return $params;
  • You need to add four lines of code before the above line of code
  • Here are the four lines of code you need to add:
    if (isset($options['maxfiles']) and $options['maxfiles'] != 0) {
        $params['plugins'] .= ',nanogong';
        $params['theme_advanced_buttons3'] .=',nanogong';
    }
    after adding these lines of code, the file will look like this:
    if (isset($options['maxfiles']) and $options['maxfiles'] != 0) {
        $params['plugins'] .= ',nanogong';
        $params['theme_advanced_buttons3'] .=',nanogong';
    }
    return $params;
 
Step 2.4 ENABLE THE NANOGONG FILTER
  • Log on Moodle as admin, and go to Home
  • It will show the 'Plugins check' page automatically, then click the 'Upgrade' button
  • The NanoGong filter will be automatically installed and you will receive a message saying that the filter was installed
  • Go to the filter management page on the site administration menu
  • Enable the NanoGong filter by setting 'Active?' to 'On' as shown in the image below
Enable the NanoGong Filter
Enable the NanoGong Filter through the Filter Management Page
(click to enlarge image)