Paper—Development and Integration of E-learning Services Using REST APIs Development and Integration of E-learning Services Using REST APIs

E-Learning systems have gained a lot of traction amongst students and academicians due to their flexible nature in terms of location independence, time, effort, cost and other resources. The rapidly changing nature of the education domain makes the design, development, testing and maintenance of E-Learning systems complex and expensive. In order to adapt to the changing policies of educational institutes as well as improve the performance of students, the paper presents a Service-Oriented Architecture (SOA) approach to minimize the cost and time associated with the development of E-Learning systems. The paper illustrates the development of independent ELearning web services and how they can be combined to implement the required policies of respective education institutes. The paper also presents a sample policy implemented using developed web services to achieve the required objectives. Keywords—E-learning;Web Services;Service Oriented Architecture;REST APIs


Introduction
With the era of internet and online information, the development of various E-Learning systems has been on the rise. Many organizations have their own different requirements when it comes to how the content should be portrayed for students to learn in an easy and comprehensible manner online. However, most of the time, the basic purpose of any E-Learning system remains the same. Instead of spending valuable time and resources from scratch, it will be much easier to integrate or reuse available modules to meet the basic purpose. This is where web service comes into play.
Services constitute the functional components in a Service Oriented Architecture (SOA). Each service performs a specific task and is considered to be self-contained. A service is generally comprised of an interface, a contract, and the implementation. The interface defines how a service provider will perform requests from a service consumer, the contract defines how the service provider and the service consumer should interact, and the implementation is the actual service code itself. As a result of this separation, the implementation details are completely hidden from the service consumer. Web services are thus pieces of software which can be made available over the internet. They provide an interface between client applications and the server where they are hosted. Essentially, this means that web services can be developed in any programming language but can be integrated in a simple manner. The two main styles of web service or API (Application Programming Interface) development are SOAP (Simple Object Access Protocol) and REST (Representational State Transfer). A Web service has a unique URI (Uniform Resource Identifier) which is used to invoke its function over the Internet.
Due to their modular and cohesive nature, web services can be combined to perform complex functions. A notable advantage of web services is that they can be developed in various programming languages and still be able to communicate with each other. In order to achieve such loose coupling, web services have been based on commonly followed standards such as SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery and Integration), and WSDL (Web Services Description Language). SOAP is a standardized protocol which allows communication between web services and clients via HTTP (Hypertext Transport Protocol) or SMTP (Simple Mail Transfer Protocol). The data is transmitted using XML (Extensible Markup Language). Figure 1 illustrates the implementation framework of an E-Learning system using SOAP. Path 1-2-3 shows the workflow of traditional monolithic applications where the container i.e. the client device sends requests and receives the processed response from the Server Object Layer via HTTP. The Server Object Layer fetches the requested information from the database via the Database Connection Layer. Path 4-5-6-7 indicate the interactions between the Service Request Layer, Service Agent Layer and Service Layer of the system. The Service Request/Response Layer is responsible for sending SOAP requests to the Service Agent Layer and receives the appropriate SOAP responses over HTTP. The requests which are parsed by the Service Agent Layer is then transmitted to the concerned E-Learning web service components. The Web Service Agent Layer upon receiving the request, locates the necessary E-Learning service by performing a lookup in the UDDI registry. As a result, the WSDL binding information is returned as a SOAP message after which the Web Service Agent Layer can invoke the E-Learning web service as required. Once the extraction and processing of the requested data has been completed, the appropriate response is sent back to the Server Object.

Fig. 1. SOAP Implementation Framework of an E-Learning System
In contrast, REST is an architectural style which has been adopted to address the limitations of SOAP. REST has a more flexible architecture and is lightweight compared to SOAP leading to better performance. Additionally, it also allows different messaging formats such as XML, JSON (JavaScript Object Notation), HTML (Hypertext Markup Language) and even plain text. Figure 2 shows a general schematic on how REST APIs are invoked by client applications via HTTP requests. Owing to the flexibility it provides, we have adopted REST-style architecture for the development of different E-Learning APIs in this paper.

Fig. 2. General Schematic of REST APIs with HTTP Requests
The rest of the paper is organized as follows. Section 2 will summarize the contributions and works of different authors in the domain of E-Learning using web services. Section 3 will describe the methodology this paper has adopted in the design and development of RESTful web services and how they have been combined to be used in the proposed E-Learning system. Section 4 analyzes the results of this paper and the conclusions have been stated in Section 5.

Literature Review/ Related Works
This section will describe some of the contributions and research which have led to the evolution of E-Learning systems.
Different components of an E-Learning system have been described by J. Pattnayak and S. Pattnaik [1]. They have also discussed the benefits and impact of integrating web services in the development of a knowledge society. Liu, Saddik and Georganas analyzed different E-Learning standards and proposed a functional model of an e-learning environment using web services [2]. The evolution of architectures of E-Learning platforms have been described by Leal and Queirós. Their papers cover component-based E-Learning systems as well as service-oriented architectures (SOA) [3]. In his paper, J. Kaur proposes an E-Education system which uses a web service oriented framework. The framework proposed by him takes into consideration the SOAP, WSDL (Web Service Description Language) and UDDI (Universal Discovery Description and Integration) standards [4].
In the context of an E-Learning environment, Zen illustrates how a web service can both be a service provider as well as service consumer. The paper also measures the performance of an orchestration architecture versus a choreography architecture and determined that orchestration style of architecture gives a better performance with less delays [5]. Khanjari, Kutti and Hatem explains the development of a prototype system architecture, which extends the service of their existing E-Learning system by integrating various software tools used in the curriculum. Their paper focuses on how integrating software tools can enhance the content of their E-Learning portal by using an architecture which is simple, distributed and cost-effective [6]. Qiu and Juloor proposes a message-based event-driven MVC (model-view-controller) architecture which accommodates both instructor-led learning and participatory learning [7]. K. Rabahallah and R. Ahmed-Ouamer illustrated the development of SOAP-based web services around which E-Learning systems can be designed and built [8]. In his paper, Peter Westerkamp describes the implementation of a prototype called 'LearnServe' which searches for the appropriate web services to be used in an E-Learning environment using the UDDI registry [9].
Many authors have taken into account the role of a cloud computing environment in the development of robust E-Learning systems. The various concepts of cloud computing combined with the features of E-Learning systems have been described using a service-oriented architecture approach [10]. K. Palanivel and S. Kuppuswami provides an architecture solution to personalized E-Learning systems using Service-Oriented Cloud Computing Architecture (SOCCA). The paper discusses how their model leverages the various services available in the cloud environment and how it can evolve traditional e-learning systems [11]. Andreica et al. extended their existing E-Learning web portal with on-demand cloud services such as emails and office applications using Microsoft Office 365 [12]. Al-Ajlan and Zedan analyzes the approach adopted by MOODLE which uses SOAP-based web services to satisfy the requirements of web based academic systems [13].
In contrast, this paper will focus on the development of different E-Learning components as web services using a REST-style architecture. Each service is independent in its own respect and can be consumed by different clients into their existing applications. Additionally, this paper also proposes how these services can be combined for rapid development of an E-Learning system by an orchestrator.

Methodology
This section will describe the different APIs (or services) which can be integrated with any E-Learning application system. The paper will then proceed to explain a sample workflow of the E-Learning application using these developed APIs.

3.1
General API development process As web services are independent software in its own respect, the lifecycle of an API can be closely related to the Software Development Lifecycle (SDLC) as shown in Figure 3.

Fig. 3. SDLC Phases for API Development Process
Planning: This phase involves important decisions such as what feature or function is to be provided by the API. Aspects such as effort, time and cost for the development process need to be considered.
Analysis: This phase breaks down the general requirements of the web service into the different components that compose it. A detailed analysis of the API in question will enable developers to focus on the relevant aspects of the service.
Design: The Design phase involves important questions such as which approach of API development needs to be followed viz. SOAP or REST. If the API is being developed for legacy applications, then SOAP would be preferable whereas RESTful APIs would satisfy the needs of many modern applications. Additionally, the database design and the authentication schemes to access the APIs must be taken into consideration. Design documents such as UML (Unified Modelling Language), ER (Entity Relationship), etc. are generated during this phase.
Implementation: This phase involves the actual development of the API based on the design agreed upon in the previous phase. Implementation itself can be performed in different environments such as the development environment, staging environment, product environment, etc.
Testing: The API once developed can be tested in many different ways. Some of the common testing techniques are unit testing, path testing, integration testing, blackbox testing and white-box testing. Once an API has been tested and verified, it can be deployed to the cloud to be integrated and accessed by client applications.
Maintenance: The Maintenance phase monitors any errors or performance concerns with respect to the API. Changes and modifications can be made but since the API is being accessed by a public service endpoint which remains unchanged, client applications consuming the API will not be affected. In case a different version of the API is being developed, the new API endpoints are prefaced with the version number in the URL of the service endpoint itself (e.g. /api/v1/… and /api/v2/…).

E-Learning system architecture
For the purpose of illustration, our model assumes that each web service has been hosted on different cloud servers. Figure 4 shows how the client's application is communication with the different APIs. In order to consume or invoke the API methods, the client's E-Learning application will need to register with the respective API. Upon successful registration, the client will receive an API authentication token from the respective servers. As REST APIs are stateless by nature, the client's E-Learning application server will need to send the correct authorization token every time it wants to invoke a function or service from the API. Based on the request sent by the client's E-Learning application server, the APIs will respond with the relevant status code and appropriate data. The client's E-Learning application server may further process the data received based on the intended business logic or workflow of the application. Thus, the client's E-Learning application server acts as an orchestrator which makes independent calls to the relevant APIs and processes the information further as required.

API development for e-learning systems
For speedy design and development, our proposed E-Learning application will consume different APIs residing on different servers. These APIs or services include Content-as-a-service, Assignment-as-a-service, Quiz-as-a-service and Forum-as-aservice.
Content-as-a-Service: As the name suggests, this API provides content as resources. Content may include learning materials in the form of PDFs, Word Documents, PowerPoint Presentations, Hyperlinks to References, etc. The API has different endpoints for students and faculty members wherein students will mainly access the learning resources for their education goals whereas faculty members will use different endpoints to upload and update the relevant materials which will be required for the students for the particular subject and topic taught by the faculty. Figure 5 shows a sample database schema upon which the Content API methods for the content have been developed. Table 1 shows some of the sample API endpoints which can be used to invoke the Content API to perform a function or access a content resource.

Assignment-as-a-Service:
This API provides functions to allow students to download assignments created by the faculty. Once an assignment has been posted, the students can view the assignment, solve it as necessary and upload their submissions for evaluation. The API allows faculty members to assign a grade to the students' submissions and add remarks if necessary. Fig 6 shows a sample database schema upon which the Assignment API methods for the content have been developed. Table 2 shows some of the sample API endpoints which can be used to invoke the Assignment API.  Quiz-as-a-Service: The Quiz API will provide functions to evaluate a student using quizzes created by the faculty. The teaching staff can create a quiz which need to be answered by the students. After students submit their answers, the API will automatically calculate the result by cross-checking the student answers with the ones provided by the faculty and display and record the score or grade. Fig 7 shows a sample database schema upon which the Quiz API methods for the content have been developed. Table 3 shows some of the sample API endpoints which can be used to invoke the Quiz API.  Forum-as-a-Service: With the help of the Forum API, users of the E-learning application can post their queries regarding a subject's topic. Once the question has been posted, other users will be able to view the question and answer it as they fit. The API also allows users to comment on answers posted for the question for further clarifications and better understanding. Fig 8 shows a sample database schema upon which the Forum API methods for the content have been developed. Table 4 shows some of the sample API endpoints which can be used to invoke the Forum API. http://www.i-jet.org

E-learning application workflow with API integration
Any developer with access to an API can integrate it into their own application and use them to define the logic and workflow of their E-learning application or environment. Figure 9 illustrates a sample workflow which can be adopted in an E-Learning Application by integrating the Content APIs, Assignment APIs and Quiz APIs. While the services themselves are independent, it is the business logic (i.e. the orchestrator) that combines the responses of these services to facilitate the workflow of the proposed application.
Algorithm 1 shows an algorithmic representation of when an enrolled student is trying to access a particular content from the client's E-Learning system. As seen from the algorithm, the APIs are invoked simply to get the relevant resources and information but the business logic is defined as per the E-Learning system's workflow which can be modified as required. For instance, the algorithm depicts that a student needs to achieve a 75% result in the respective quizzes before proceeding and accessing new content. This policy can be changed easily by the E-Learning system without affecting the use of the APIs.
Algorithm 1: Business Logic for Integration of Web Services

Fig. 9. Workflow of API Integration
Student enrollment process: This process refers to the users or students enrolling or registering themselves for a course using the client's E-Learning application. The details of the students enrolling for a subject or course will be stored on the client's E-Learning application database. None of the API servers will store information of the users except for the user ID assigned by the client's application (if required). Using this user ID, the client's application will be able to query the necessary information from the API for a particular user.

Content retrieval and study process:
This process refers to the users of the client's E-Learning application being able to retrieve the relevant study materials for a topic assigned by the instructor. In our proposed system, we have defined the business logic such that the user can access certain content only after fulfilling certain conditions. These conditions include if the enrolled student has successfully completed an assignment or quiz before proceeding with the course content available in the E-Learning application. When a student wants to access more course-related content, he or she may mark the content as 'completed' which indicates that they have studied and understood the contents fairly well.
Assignment process: The assignment process refers to the enrolled students completing an assignment which is made available on the system by the instructor. The instructor will be able to view the submissions of the students and grade them. If the student has successfully completed the assignment, he or she may proceed to view more content related to the course.
Quiz process: The quiz process allows instructors to evaluate the knowledge of the enrolled students for a particular course. The Quiz API will store the answers given by the users and automatically calculate the results of the users. The client's E-Learning application will then use this information to determine whether or not the user has cleared the quiz and is eligible to access more course materials. If a student is deemed ineligible, then he or she will have to reattempt the quiz in order to proceed with the course. The number of attempts may be determined by the policy defined by the client's E-Learning application.

Results
The integration of APIs reduces the development cost of complex systems. It allows developers to offload the subtleties related to a feature or module to a third party. With API integration, changes in the business logic will not lead to a major restructuring of the application due to the independent and stateless nature of APIs. An important aspect of APIs is that they are easily testable and their functions are verifiable due to the easy availability of API testing tools. This allows clients to evaluate whether or not an API aligns with their application's business requirements. The following subsections discusses the developed system with screenshots.

Register and log-in
Joe registers themselves as a Learner ( Figure 10). His account will not have access to the Edit services, which are granted only to an Instructor.

Fig. 10. Registration Form for E-Learning System
Once Joe has registered themselves, he can proceed to login to the E-Classroom to access the services for Learners ( Figure 11).

Forum and posts
After logging in, Joe can write a post to ask doubts or start a discussion. Posts can also be used to add extra content that the Learners might consider relevant for each other (Figures 12 & 13). Joe may update or delete his posts to make any further changes ( Figure 14).

Content
Since Joe is a learner, he can access the Learner's Content service ( Figure 15). Here, he needs to mark the course material that has been completed as such. He will be able to access the Learner's Quiz and Assignment services only if he has completed the course material.

Fig. 15. Accessing Learner's Content in the E-Learning System
Suppose Jill Teacher is an Instructor; she will be redirected to the Content Edit service ( Figure 16). Here, she can update the course material.

Quiz
Joe will be able to access the Learner's Quiz service only if he has completed the Learner's Content service (Figure 17). Here, he needs to answer all the quiz questions to get a score at the end of the service.

Fig. 17. Attempting a Quiz after completing course materials
Jill will be able to edit the quiz using the Quiz Edit service since she is an Instructor (Figure 18).

Assignment
Once Joe has completed his Course Material and Quiz, he may now want to upload his assignment in PDF (Figure 19). Jill, as an Instructor, can make a Post as a notification to let the Learners know what the assignment is. Fig. 19. Uploading an Assignment in the E-Learning System

Conclusion and Future Scope
E-Learning systems facilitate easy management of student records, enforce institute-specific policies and help improve the performance of students. To adapt to the changing requirements and emerging problems of various industries, E-Learning systems can evolve by adopting an SOA approach to increase efficiency and minimize related costs in its development. This paper presented the development of an SOA E-Learning system from the perspective of an institute's changing policies and workflow. In the future, we plan on the development of web services which can determine the preferences of the students so that the E-Learning system can present the content based on the learning style of the respective student.