Difference between revisions of "Preparing Moodle 20"

From Joomdle
Jump to: navigation, search
Line 14: Line 14:
 
{{End of Section}}
 
{{End of Section}}
  
==Setting up Moodle Web services==
+
==Configuring Moodle for Joomdle==
  
Moodle 2.x introduces a new Web Services approach to integration with external applications like Joomdle.  As such, beginning with Moodle 2.x, to integrate Joomdle with Moodle, you will need to complete the following steps to configure Moodle's Web services.
+
In newest Joomdle versions, all required Moodle setup is done automatically when Joomdle package is installed.
  
 
To make it easier Moodle  2, has created a Step-by-step table that you can following for configuring Moodle's Web Services.  This can be found here
 
 
 
Site Administration->Plugins->Web services->Overview.
 
 
 
[[File:wsoverview.png]]
 
 
 
{{End of Section}}
 
 
==Enable web services==
 
 
Enable Web Services.  The status should change to Yes
 
 
[[File:enablews.png]]
 
 
 
{{End of Section}}
 
 
==Enable protocols: XMLRPC==
 
 
Joomdle leverages XMLRPC to connect with Moodle.  Therefore, select 2. Enable Protocols from the table and enable XMLRPC.  You will need to ensure that your webhost has the PHP XMLRPC libraries loaded and enabled.  Refer to [[Prerequisites#PHP_Prerequisites | PHP Prerequisites]] for more information.
 
 
 
 
[[File:enablexmlrpc.png]]
 
 
{{End of Section}}
 
 
==Create a specific user==
 
 
Moodle's Web Services requires a "user" to connect with Joomdle.
 
 
 
To configure Moodle's Web Services, we need to define a specific "user" which will be given the appropriate access to "enter" / connect with Moodle.  Ideally, this "user" should be used '''only''' for connecting Joomla to Moodle.  It should '''not''' be used as a typical Joomla front end or Joomla backend user.  Also, it should not be your Joomla or Moodle system admin user.  For example, we created a user called '''joomdle connector'''.
 
 
{{End of Section}}
 
 
==Check user capability==
 
 
====Check user permissions====
 
 
For Joomdle to connect to Moodle using Web services, a specific user must be created in Moodle, as defined above.  Once defined this user must be given the appropriate access to the Web services protocol being used, XML-RPC.  This is done by defining a role, assigning the user to that role and then granting that role access to the Web services.  In this section, we show you how to:
 
* Check the permissions of existing users
 
* Create a new role
 
* Assign a specific user, eg. Joomdle Connector, to a given role
 
 
 
From the table click on 4. Check user capability.  Select the user who you have created to be the Web services user and press the '''Show this user's permissions''' button.
 
 
 
 
[[File:Checkpermissions.png]]
 
 
Scroll down until you see XML-RPC and ensure this is set to yes.  The background colour will have changed as well.  In this case the background colour is light blue/green indicating it is set to yes in comparison to pink for no.
 
 
If it is not set to '''Yes''' you will need to do one or more of the following:
 
* Create a new role
 
* Assign the user to the specific role
 
 
[[File:Checkuserpermission.png]]
 
 
{{End of Section}}
 
 
====Define a new role, to manage access to Joomdle Web services====
 
 
To define a new role, go to Site Administration->Users->Permissions->Define roles, and click the 'Add a new role' button.  Then enter a unique name, short name and description.  These should be something that you will recognise relating to Joomdle services.
 
 
[[File:newrole.png]]
 
 
Then, check 'System' as Context types where this role may be assigned.
 
 
Scroll down looking through the Capability table and Allow (check):
 
* Use XML-RPC protocol
 
* View discussions
 
 
[[File:capabilities.png]]
 
 
{{End of Section}}
 
 
====Assign the user to the new role====
 
 
After you have created the new role, you will need to add your Joomdle Web services user (eg. joomdle connector) to this role.
 
 
Go to Users->Permissions->Assign System roles, and select the new role.
 
 
 
[[File:assignrole.png]]
 
 
{{End of Section}}
 
 
==Add a new service==
 
 
Next we must add a new "service" for Joomdle.  This "service" will allow you to define what Joomdle can do inside Moodle.  For example pulling course details information from Moodle or creating a new user in Moodle.  This task is split into two tasks:
 
* Create a new service
 
* Defining what functions this new service can perform (See the next section)
 
 
This is done in Site Administration->Plugins->Web services->External services
 
 
[[File:newservice.png]]
 
 
==Add functions to service==
 
 
Normally, this would be the first time you are setting up Joomdle on this webserver.  Therefore, it is assumed the '''Joomdle for Moodle''' has not been installed and you will not be able to perform this task at this time.  Instead, this activity will be completed as part of the [[Installing Joomdle in Moodle 2|Installing Joomdle in Moodle 2.x]] task.
 
 
 
 
If Joomdle has already been installed, you can perform this task now.  The details of this task can be found here [[Installing Joomdle in Moodle 2#Add_functions_to_service|Add Functions to Service]]
 
 
{{End of Section}}
 
 
==Add user as authorized user for the service==
 
 
Now that we have created a new service and added the appropriate functions (All Joomdle functions), we need to authorise / grant the Joomdle Web services 'user' to the newly created service.  This is done in:
 
 
Site Administration->Plugins->Web services->External services
 
 
Click on '''Authorized users for the new service''' and add the Joomdle Web services '''user''' we created before.
 
 
[[File:adduser.png]]
 
 
{{End of Section}}
 
 
==Create token==
 
 
The final step is to create a '''token''' which will be entered in Joomdle configuration page in the Joomdle Joomla component.  Without this token, even if everything is configured in Moodle, Joomla and Joomdle correctly, Joomdle will not be able to connect with Moodle.
 
 
In the Moodle Administration menu:
 
 
Site Administration->Plugins->Web services->Manage tokens, click on Add.
 
 
[[File:addtoken.png]]
 
 
 
Select the user and the service we created, and Save.
 
 
[[File:tokens.png]]
 
 
 
You will get a new token, to enter in Joomdle's component configuration in Joomla.  Refer to this page for entering the token in Joomdle.
 
  
 
==Allow frame embedding for wrapper==
 
==Allow frame embedding for wrapper==
  
In most recent Moodle version, you will need to enable an option if you want to use the Joomdle wrapper.
+
In most recent Moodle versions, you will need to enable an option if you want to use the Joomdle wrapper.
  
 
In Site Administration->Security->Http Securty, enable option '''Allow frame embedding'''
 
In Site Administration->Security->Http Securty, enable option '''Allow frame embedding'''

Revision as of 10:14, 24 April 2017

This document applies to Joomdle Release 2.0.0

Moodle 2 Prerequisites

If you are installing Moodle for the first time, it will check for the existence of the PHP extension XML-RPC.  Please ensure it is installed.

xmlrpc_check.jpg

For further information on PHP XML-RPC libraries refer to PHP XML-RPC Prerequisites


.

Configuring Moodle for Joomdle

In newest Joomdle versions, all required Moodle setup is done automatically when Joomdle package is installed.


Allow frame embedding for wrapper

In most recent Moodle versions, you will need to enable an option if you want to use the Joomdle wrapper.

In Site Administration->Security->Http Securty, enable option Allow frame embedding