Developing Moodle Plugin for Creating Learning Content with Another REST Function Call
Authors: Irwan Alnarus KautsarΒΉΒ², Yasuo MusashiΒΉ, Shin-Ichiro KubotaΒ³, Kenichi SugitaniΒΉ
ΒΉ CMIT Lab., GSST, Kumamoto University, Japan
Β² Universitas Muhammadiyah Sidoarjo, Indonesia
Β³ Department of Computer Science and Systems Engineering, University of Miyazaki, Japan
Published in: 2014 IEEE Global Engineering Education Conference (EDUCON), 3-5 April 2014, Istanbul, Turkey. pp. 784β787
DOI: 10.1109/EDUCON.2014.6826183
IEEE: https://ieeexplore.ieee.org/document/6826183/
Abstract
The Moodle REST function calls enable third party applications having access to the Moodle database through Moodle web services and REST (Representational State Transfer) protocols. The access could be for learning content creation. According to Moodle architecture, learning content creation needs to be placed on Moodle section tables. This shows a third party application should make or use the Moodle section when making a course. The "section" is the most essential component on Moodle because the section contains documents, assignments, and quizzes for learners.
However, some Moodle REST function calls, such as creating the "section" on Moodle courses, have not been implemented in the Moodle system yet. For our current development applications, it needs to have access to create complete learning content on section tables. With developing Moodle plugins, it is possible to create learning content in the Moodle sections, but a Moodle REST function call is needed to access the developed plugin. Therefore, we propose solutions that develop a Moodle plugin to create learning content and solve an unprovided Moodle REST function call by developing another Moodle REST function call.
As a result, with the developed Moodle plugin, we successfully created learning content on Moodle LMS and developed another Moodle REST function call.
Keywords: Moodle, LMS, REST Function Call
I. Introduction
In 2013, more than 1500 Moodle instances had already been implemented among 3200 Higher Education Institutions (HEI) in Indonesia [1][2]. Using Moodle in Indonesia is limited by Internet infrastructure matters [3].
Our previous work described the importance of developing an authoring supportive tool that solved two problems. First, the ease of use issue: with the developed supportive tool, a lecturer could create a course with no complex configuration compared to installing Moodle on a local machine. Second, fitting Indonesia's infrastructure, which still has a bandwidth gap, meaning lecturers cannot access Moodle to create learning content online [4]. We proposed solutions enabling lecturers to create learning content offline, then upload it when the lecturer's laptop connects to the Moodle server through the Local Area Network.
Those solutions were implemented by developing a third party application that successfully creates a course on the remote Moodle Server through Moodle web service. Accessing Moodle through web services is more secure and convenient because the administrator does not need to configure a user password for each lecturer.
However, the developed third party application only successfully creates a course. We found the problem that not all Moodle REST Function Calls are available to create complete learning content. This paper presents work in progress to solve this problem by developing two plugins: one to create learning content, and a second to create an external Moodle REST Function Call to access the created learning content.
II. Moodle Learning Content, REST Function Call and Problem Analysis
A. Moodle Learning Content
Each learning content is defined on a Moodle course. On the Moodle course itself, each learning session is placed in a space called a section [4]. Within each section is a learning activity or resource. According to the Moodle database, each learning content is defined by three kinds of tables:
mdl_courseβ stores the identity of each course (name, description), but not the learning contentmdl_course_sectionβ the section table- Learning activity tables β by default provided in 12 kinds of format (e.g. SCORM stored in
mdl_scorm, Quiz, Forum)
While creating complete Moodle learning content, Moodle stores data across those three kinds of tables [4][5].
Fig. 1. Architecture of Moodle Learning Content
B. REST Function Call
Accessing the Moodle database (create, read, update, delete), instead of using user and password, can be done using the REST Protocol [6][7]. The REST Protocol on Moodle uses functions called "REST Function Call." For example, requesting data of a Moodle course with the REST function call named core_course_get_courses.
To use those REST Function Calls, you need other information such as the Moodle server address and a token provided by Moodle. Combining the Moodle server address, token, and REST function call into a single URI could request Moodle data.
Table I. Example URI Request Moodle Data
http://localhost:8888/moodle/webservice/rest/server.php?wstoken=3a5ae337b990d6dd4f5edfd336b94f3a&wsfunction=core_course_get_courses&options[ids][0]=2
The URI consists of three components: (1) Moodle Server Address, (2) Token, (3) Moodle REST Function Call.
Fig. 2. Moodle Server Respond
C. Problem Analysis
To make one complete learning content, you should have access to several tables in the Moodle Database. We analyzed that not all REST Function Calls are provided by Moodle. For example, the REST function call to create a section. Creation or access to a section table (mdl_section) is needed because learning activity must be placed on a Moodle section. Although the development of a REST Function Call to create a section has already been proposed by Moodle Developers, it is not implemented yet [8].
III. Method and Experiment Result
Within Moodle web service support for the REST Protocol, it is possible to access Moodle through mash-up methods [9][10]. Our proposed method solves the limitation by developing a plugin to create our own learning activities, then accessing the plugin with an external REST function call. Two plugins have been developed:
A. The xlmsmemod plugin
This plugin was developed to create learning activities from outside Moodle through Moodle web services.
Fig. 3. The xlmsmemod plugin
When installed, this plugin creates a new table called mdl_xlmsmemod on the Moodle database. To test the effectiveness, we created an example activity with parameters (Name: Course8-1-1, Description: "This content is on course 8 section 1 number 1").
Fig. 4. Learning activity created with the xlmsmemod plugin on Moodle course sections
Table IV. Record on Table mdl_xlmsmemod
| id | Course | name | intro | Introformat | timecreated |
|---|---|---|---|---|---|
| 103 | 8 | Course8-1-1 | This content is on course 8 section 1 number 1 | 1 | 1387194699 |
With guidance from Moodle's obsolete documentation pages [4], we analyzed the relationship between fields from mdl_xlmsmemod and other Moodle core tables.
Fig. 5. A relationship of the records stored on the Moodle database table
Fig. 6. Relation Table Developed Plugin and Core Moodle Tables
Our experiment target was not to document the relationships, but to understand the prerequisites of what records need to be inserted in the related tables, and what tables need to be affected, to make learning content/activity from our current development supportive tool.
We tested the research question: "Did we only need to insert one record to the mdl_xlmsmemod table, as an alternative way to create a learning activity with the xlmsmemod plugin instead of creating Moodle sections?"
After manual insertion experiments, we found that to make learning content/activity, it is not only necessary to insert records into mdl_xlmsmemod, mdl_course, mdl_course_sections, mdl_course_modules, but also other records in additional tables in the Moodle database not yet described.
B. The xlmsmemodws plugin
The second developed plugin was xlmsmemodws. Its main function is to access the xlmsmemod plugin (which has direct access to Moodle Databases). The "ws" means "web services." This plugin enables access to the mdl_xlmsmemod table through an external Moodle REST function call.
The result of developing the second plugin was successfully creating a new external REST function call, called xlmsmemod_create_activity.
Fig. 7. New REST function call shown in Moodle API Documentation
While developing Moodle plugins, we found an issue not documented in Moodle references: the use of the dash character "-" for naming the developed plugin will cause Moodle to not detect the new plugin being installed. This could consume researcher time.
IV. Conclusion and Future Works
With a new external REST Function Call for creating learning activity, an opportunity opens to obtain mash-up applications from Moodle web services.
Other issues need to be addressed: the correct relationships within the table created by the external plugin and the Moodle core table, then confirming that the learning activity is successfully shown by inserting a record manually in the Moodle Database, instead of through Moodle's section interfaces.
By developing synchronization methods from our current development third party application to Moodle, this became our approach towards interoperability of Moodle use that fits with Indonesia's internet infrastructure.
References
[1] B. Y. Moeliodihardjo et al., "University, Industry, and Government Partnership: Its Present and Future Challenges in Indonesia," Procedia - Social and Behavioral Sciences, vol. 52, pp. 307β316, 2012.
[2] Moodle Registered Sites. https://moodle.org/sites/index.php?country=ID
[3] R. M. Ijtihadie et al., "Dynamic Content Synchronization between Learning Management Systems over Limited Bandwidth Network," Human-Centric Computing and Information Sciences, vol. 2, no. 1, p. 17, 2012.
[4] I. A. Kautsar, S. Kubota, Y. Musashi, K. Sugitani, prior work on Lecturer Based Supportive Tool.
[5] Moodle database schema documentation.
[6] R. T. Fielding, REST architectural style.
[7] Moodle Web Services documentation.
[8] Moodle Developer tracker: proposed REST function call for section creation.
[9] Mash-up methods for web services.
[10] Web service composition references.
This is a preprint (author self-archived) version. The version of record is available at IEEE Xplore.