Articles with the tag:
Close
Changelog
Close
Try in the cloud
Try in the cloud
Help Center
Integration

About the ONLYOFFICE and Moodle integration

ONLYOFFICE offers an official connector to integrate ONLYOFFICE Docs with Moodle and edit office documents attached to the course pages. You can download the ONLYOFFICE connector from the Moodle plugin library or the GitHub page.

You can also install the Moodle AssignSubmission ONLYOFFICE Integration plugin. This plugin is an extension of the main Moodle plugin and allows users to add a custom submission of the "ONLYOFFICE document" type in the pdf format.

Main features

  • Editing and viewing text documents, spreadsheets, presentations, and forms.
    To learn more about forms, please read the corresponding articles for creating and filling out forms.
  • Co-editing documents in real-time: two co-editing modes (Fast and Strict), the Track Changes mode, comments, and the built-in chat.
  • JWT support to secure your traffic so that no one can have access to your documents with the exception of the users with proper rights.

Supported formats

  • For viewing and editing: DOCX, XLSX, PPTX, DOCXF
  • For viewing only: TXT, CSV
  • For filling forms: PDF

What's new in version 4.4.0

Added

  • desktop mode
  • disable plugins setting
  • macro launch setting
  • dsi-LK, ar-SA and sr-Latn-RS empty file template
  • service for checking editor versions

Changed

  • fixed saveas dialog
  • support moodle v4.3

The full change log is available here.

Connecting ONLYOFFICE Docs to Moodle

Requirements

  • ONLYOFFICE Docs (Document Server) 6.1.0 or higher

    You need an instance of ONLYOFFICE Docs that is resolvable and connectable both from Moodle and any end clients. It must be able to POST to Moodle directly.

    Please refer to the official documentation page to learn more about installing ONLYOFFICE Docs.

    You can also use ONLYOFFICE Docs Cloud (SaaS version).

  • Moodle v3.9 or later
  • ONLYOFFICE connector v4.4.0 is used for Moodle v4.3.0; v4.3.0 is used for Moodle v4 < 4.3.0; v4.2.0 is used for Moodle v3.9 - 3.11

Installing the ONLYOFFICE connector for Moodle

Using the Moodle plugin library
  1. Log as an admin into your Moodle instance and go to Site administration > Plugins > Install plugins.
    If you can’t find this location, then plugin installation is disabled on your site.
  2. Click the Install plugins from Moodle plugins directory button.
  3. Select your current Moodle version.
  4. Search for the ONLYOFFICE document plugin.
  5. Click the Install button, then click Continue.
  6. Confirm the installation request.
  7. Check the plugin validation report.
    It is extremely important that you choose your Moodle version correctly. If you mistakenly download and install the wrong version of the plugin for your Moodle server, this may lead to some serious problems, even freezing of the Moodle site.
Using the GitHub .ZIP archive
  1. Download the connector from the GitHub page.
  2. Log into your Moodle instance as an administrator, go to the Site administration section, switch to the Plugins tab, and click the Install plugins link.
  3. Upload the moodle-mod_onlyofficeeditor-x.x.x.zip file via the file picker or drag-and-drop it to the corresponding field and click the Install plugin from the ZIP file button.
    ONLYOFFICE_connector ONLYOFFICE_connector
  4. Check the plugin validation report and click Continue.
    If your target directory is not writable, you will see a warning message, e.g. [Error] Write access check [/var/www/html/moodle/mod]. In this case, you can temporarily make it writable by using the following command:
    sudo chmod -R 777 /var/www/html/moodle

    After that, repeat Step 3.

    After installing the plugin, you need to revert permissions so that the directory is no longer writable. Use the following command:

    sudo chmod -R 0755 /var/www/html/moodle
  5. Click Continue on the Current release information -> Server checks page.
  6. Click Upgrade Moodle database now on the Plugins check page.
    ONLYOFFICE_connector ONLYOFFICE_connector
  7. Click Continue on the Upgrading to new version page.
Installing the Moodle AssignSubmission ONLYOFFICE Integration plugin
Please note: the Moodle AssignSubmission ONLYOFFICE Integration plugin requires the main ONLYOFFICE plugin to be installed.
  1. Log as an admin into your Moodle instance and go to Site administration > Plugins > Install plugins.
    If you can’t find this location, then plugin installation is disabled on your site.
  2. Click the Install plugins from Moodle plugins directory button.
  3. Select your current Moodle version.
  4. Search for the ONLYOFFICE Assign Submission plugin.
  5. Click the Install button, then click Continue.
  6. Confirm the installation request.
  7. Check the plugin validation report.
    It is extremely important that you choose your Moodle version correctly. If you mistakenly download and install the wrong version of the plugin for your Moodle server, this may lead to some serious problems, even freezing of the Moodle site.

Alternatively, you can download the plugin from the GitHub page and install it from the ZIP file.

Configuring the ONLYOFFICE connector for Moodle

Once the plugin is installed, the plugin settings page will be opened. Alternatively, you can find ONLYOFFICE document on the Plugins overview page and click Settings. On the Settings page, you can configure the following parameters:

  • Enter the address that is used to access Document Editing Service from Moodle into the Document Editing Service address field. This field is obligatory.
    ImportantThe address of ONLYOFFICE Docs must be accessible from Moodle, as well as the address of Moodle must be accessible from ONLYOFFICE Docs.
  • Optionally, specify the secret used to sign the data in the Document Server Secret field. The secret key is used to validate the JSON web token upon the request to Document Server. To learn more, check the API documentation for configuring JWT on the ONLYOFFICE Docs side.
    Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to enable it on the Moodle side as well: find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings. For more details, see the Enabling JWT for the ONLYOFFICE and Moodle integration section of this article.
  • Enable Force Save - when this option is disabled, your changes are saved to the editors’ cache automatically. When this option is enabled, all changes to a document are sent to the storage directly when you click the Save button.
    ONLYOFFICE_configure ONLYOFFICE_configure
  • Optionally, specify the editor customization settings by checking the necessary boxes:
    • Display Chat menu button - this option is used to display or hide the Chat menu button.
    • Display Help menu button - this option is used to display or hide the Help menu button.
    • Display the header more compact - this option is used to display the additional action buttons either in the upper part of the editor window header next to the logo or in the toolbar.
    • Display Feedback & Support menu button - this option is used to display or hide the Feedback & Support menu button.
    • Display monochrome toolbar header - this option is used to display the editor toolbar in monochrome.
    • Enable plugins - this option is used to enable/disable the Plugins tab in the editors interface.
    • Run document macros - this option is used to enable/disable autorun for all macros within the document. You can always run macros manually.

When ready, click Save changes.

ONLYOFFICE_configure ONLYOFFICE_configure
Please note: the Moodle AssignSubmission ONLYOFFICE Integration plugin does not require additional settings – all the settings are configured from the main plugin.

Enabling JWT for the ONLYOFFICE and Moodle integration

To protect documents from unauthorized access, ONLYOFFICE editors use the JSON Web Token (JWT). The token is added in the configuration when the Document Editor is initialized and during the exchange of commands between inner ONLYOFFICE Docs services. The secret key is used to sign the JSON web token and validate the token upon the request to ONLYOFFICE Docs.

Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings.

Step 1: Find your secret key in the ONLYOFFICE Docs configuration file

  1. Open the local.json file with any available text editor.
    • For Linux - /etc/onlyoffice/documentserver/local.json
    • For Windows - %ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.json
    • For Docker – enter the ONLYOFFICE Docs container using the docker exec -it <containerID> bash command and open /etc/onlyoffice/documentserver/local.json

    The local.json file should look like this:

    {
      "services": {
        "CoAuthoring": {
          "token": {
            "enable": {
              "request": {
                "inbox": true,
                "outbox": true
              },
              "browser": true
            }
          },
          "secret": {
            "inbox": {
              "string": "yoursecret"
            },
            "outbox": {
              "string": "yoursecret"
            },
            "session": {
              "string": "yoursecret"
            }
          }
        }
      }
    }
    
  2. The true value is specified in three sections. It means that token validation is enabled.
    • services.CoAuthoring.token.enable.browser
    • services.CoAuthoring.token.enable.request.inbox
    • services.CoAuthoring.token.enable.request.outbox
  3. The automatically generated secret key is specified in three sections. You can replace the default secret value with your own secret key. The secret key must be the same in three sections.
    • services.CoAuthoring.secret.inbox.string
    • services.CoAuthoring.secret.outbox.string
    • services.CoAuthoring.secret.session.string
  4. If you make changes, save them and restart the services for the config changes to take effect.
    supervisorctl restart all

Step 2: Specify the same secret key in the connector settings

In the connector settings, specify the same secret in the Secret key field and save the settings.

Start using ONLYOFFICE Docs within Moodle

Adding ONLYOFFICE activities

To create a new ONLYOFFICE activity:

  1. Open the My Courses section and switch to the necessary course.
  2. Activate the Edit Mode using the switcher at the top right corner.
  3. Click Add an activity or resource.
  4. Select the ONLYOFFICE document activity in the pop-up window.
    ONLYOFFICE_editfile ONLYOFFICE_editfile
  5. Type in the activity name, create, upload or drag-and-drop the necessary document from your PC and click the Save and display button.
    ONLYOFFICE_editfile ONLYOFFICE_editfile

    The activity can be an empty .docx, .xlsx, .pptx or .docxf file.

The document will be opened in the ONLYOFFICE Docs editor.

ONLYOFFICE_editfile ONLYOFFICE_editfile

Viewing and editing files

ONLYOFFICE activities will be marked with the ONLYOFFICE_editfile icon on your course pages. To open a document in the ONLYOFFICE Docs editor, just click its title.

ONLYOFFICE_readfile ONLYOFFICE_readfile

To open the editor in fullscreen mode, click the Open full screen button at the top right corner above the editor window.

Adding submissions

Please note: the Moodle AssignSubmission ONLYOFFICE Integration plugin is required to build advanced digital forms for Moodle assignments.

To add a custom submission of the "ONLYOFFICE document" type in the .pdf format,

  1. Open the My Courses section and switch to the necessary course.
  2. Activate the Edit Mode using the switcher at the top right corner.
  3. Click Add an activity or resource.
  4. Select the Assignment activity in the pop-up window.
  5. In the Submission types tab, select the ONLYOFFICE document type. Once done, the form creator (.docxf) will become available on the Assignment creation/editing page – here you can prepare a form which will become available for students to fill out after saving.
  6. Click Save and return to course or Save and display. The created assignment will appear in the course section.
ONLYOFFICE_assignments ONLYOFFICE_assignments

Filling out forms

To fill out the form,

  1. Select the created assignment and click Add submission.
    ONLYOFFICE_assignments ONLYOFFICE_assignments
  2. The form in the .pdf format will open (for Docs v8.0 or later. For older versions, the .oform format is used). Each student gets their own copy of the pdf form and works on their own assignment.
  3. Fill out the form and click Save changes.

A teacher can view all assignments by clicking the View all submissions button.

Protecting files with a password

ONLYOFFICE files can be protected with a password so as to prevent unauthorized access. To do that,

  1. Go to the File tab at the top toolbar.
  2. Select the Protect option.
  3. Click the Add password button.
  4. Set a password in the Password field and repeat it in the Repeat password field below, then click OK.

    The password cannot be restored if you lose or forget it. Please keep it in a safe place.

To change a password,

  1. Go to the File tab at the top toolbar.
  2. Select the Protect option.
  3. Click the Change password button.
  4. Set a password in the Password field and repeat it in the Repeat password field below, then click OK.

To delete a password,

  1. Go to the File tab at the top toolbar.
  2. Select the Protect option.
  3. Click the Delete password button.

To disable the protection option,

  1. Go to the activity editing page.
  2. Open the Document permissions section.
  3. Check the Hide Protection tab box.

Managing permissions

Admins/Teachers can choose whether or not documents can be downloaded or printed from inside the ONLYOFFICE editor. This can be done in the Document permissions section.

ONLYOFFICE_editfile ONLYOFFICE_editfile

To change the document permission to read-only:

  1. Open the needed ONLYOFFICE document.
  2. Go to More -> Permissions.
  3. Find the Edit ONLYOFFICE document activity/View ONLYOFFICE document activity entry.
  4. Add the required roles in the Prohibited section or remove the ones from the Roles with permission section.
ONLYOFFICE_editfile ONLYOFFICE_editfile

To learn how to mark the document as favorite right in the editor, please follow the instructions from this article.

Download Best editors on your website Let your site users view, edit and collaborate
on all types of text, spreadsheet and presentation files
You Might Also Like This:
Close