Prerequisite knowledge
 
  • A general understanding of Adobe Digital Publishing Suite and Moodle.
User level: All
 
Required Adobe products (retail)
 
Additional required other products (third-party/labs/open source)
 
Sample files
 
By downloading software from the Adobe website you agree to the terms of our license agreement. Please read it before downloading.
 

 

Note: If you have questions about this article, use the DPS forum. Please don’t contact technical support with questions about Adobe Developer Connection articles.

 


 
Introduction

This article will show you how to create a single DPS app that integrates with Moodle by allowing a user to login to the app with their Moodle credentials. Once a user is logged in, they will see their courses and any folios associated with a course. This example includes a PHP file that retrieves a user’s courses using either Moodle credentials or a user ID.
 

 
App Walkthrough

The login dialog. Users log in with their Moodle credentials.
The login dialog. Users log in with their Moodle credentials.
 
 
The logged-in view. Courses are retrieved from Moodle with the associated folios displayed.
The logged-in view. Courses are retrieved from Moodle with the associated folios displayed.
 
 
The detail view for a folio.
The detail view for a folio.
 

 
Building the app

The steps to build the viewer are:
 
  1. Set up Moodle.
  2. Create templates from the DPS Configurator.
  3. Create the viewer in App Builder.
 
1. Moodle
In order to associate a Moodle course with a folio(s) you must associate it with a product id. To associate a course with a folio you need to add the product ID to the Course ID number field in the Edit course settings page. If you like to associate more than one folio to a course, you can add multiple folios by separating the product IDs with a comma. The Course ID number field is not used by Moodle. It is used to match the Moodle course to external systems and is not displayed anywhere in Moodle.
 
The Course ID number field that is used to enter folio product IDs. When the viewer gets the list of courses, it will look at this field and look for the matching folio for the respective product ID.
The Course ID number field that is used to enter folio product IDs. When the viewer gets the list of courses, it will look at this field and look for the matching folio for the respective product ID.
 
 
To get the course information from Moodle into the viewer, upload the attached getEnrolledCourses.php to your Moodle root. Take note of the URL to this page. This page will take either a user’s Moodle credentials or user ID to retrieve a list of courses.
 
2. DPS Configurator
 
This example uses two custom tab templates which are available for you to configure using the DPS Configurator. The custom tab that displays the Moodle courses and allows users to download folios is the template “Custom View with Moodle.” This template only functions if the user is online so you will need to either use the default library or replace the default library with a custom tab that has offline functionality. In this example, the custom tab that displays the library is the template Library.
 
 
Modifying the Custom View with Moodle template
 
 
To edit the Custom View with Moodle template, select it and click Next. If you would like to view your own folios in the configurator, enter your DPS Adobe ID that you use for Folio Producer and then click next. This is not required and is only used in the configurator to display folios.
 
The Moodle template in the configurator.
The Moodle template in the configurator.
 
 
The Edit View will allow you to update the UI with your own colors, fonts and images. To integrate your Moodle courses, set the URL in the field Moodle URL. This URL must be the absolute path to getEnrolledCourses.php that you uploaded previously.
 
If you like to toggle the logged-in/logged-out state, click the View logged-in state check box. This setting has no bearing on the custom tab at runtime. It is only there to allow you to view the logged-in and logged-out states.
 
Once you are done modifying the template, click Download ZIP.
 
 
Modifying the Library template
To edit the Library template, select it and click Next.
 
The Edit View for the library template.
The Edit View for the library template.
 
 
Edit the template to your needs and then click Download ZIP.
 
 
3. App Builder
App Builder is used to create your DPS viewer. For instructions on using App Builder, see the help. For this example, create a Multi Folio viewer.
 
In the Navigation Toolbar screen, add the two zips you had downloaded previously. To replace the default library with your library zip, click Use custom app library and navigate to your zip.
 
Once you have downloaded your IPA from App Builder, install it on your device for testing.
 

 
Troubleshooting your viewer

 
Unable to login
If you are unable to login, verify whether the path to getEnrolledCourses.php is correct and is accessible from your viewer. If this is correct, verify that you are using the correct user credentials.
 
 
Courses are not displaying
If you have logged in and courses are not displaying, go back to Moodle and verify that your user is enrolled in courses.
 
 
Folios are not displaying
If folios are not displaying with your course, verify that you have entered the correct product ID in the Course ID number field. If you are using multiple folios, verify they are seperated by a comma.
 

 
Where to go from here

This article walked you through how to create a viewer that integrates Moodle. For more information on creating apps, check out Creating Proof of Concept Apps for DPS.
 
Comments are currently closed as we migrate to a new commenting system. In the interim, please provide any feedback using our feedback form. Thank you for your patience.