You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/324555053

Virtual laboratory with experiment manager implemented into Moodle

Conference Paper · January 2018


DOI: 10.1109/CYBERI.2018.8337541

CITATIONS READS

0 19

3 authors, including:

Erich Stark Erik Kucera


Slovak University of Technology in Bratislava Slovak University of Technology in Bratislava
10 PUBLICATIONS   7 CITATIONS    33 PUBLICATIONS   12 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Weld quality inspection using modern methods for Industry 4.0 View project

Modelling of automated storage and retrieval systems (AS/RS) using Petri Nets View project

All content following this page was uploaded by Erik Kucera on 17 April 2018.

The user has requested enhancement of the downloaded file.


Virtual Laboratory with Experiment Manager
Implemented into Moodle
Erich Stark, Pavol Bisták, Erik Kučera
Faculty of Electrical Engineering and Information Technology
Slovak University of Technology in Bratislava, Slovakia
Email: erich.stark@stuba.sk, pavol.bistak@stuba.sk

Abstract—The paper demonstrates how existing virtual lack of good teachers. Although at present there are already
laboratory can be extended with more experiments thanks to online courses that provide instructional videos, but it solves the
experiment manager. As a base project StarkLab was used which problem only partially. Thanks to internet experiments can be
uses JavaScript for both client and server implementations. Based structured for visualization and control remotely. Nowadays, a
on the previous work, the aim was to propose enhancements and
create new activity module for education software Moodle which
lot of equipment already provides an interface to connect
would simulate different experiments. This module combines computer and process data from it. Experimenting over the
variety of technologies, but it is based on JavaScript framework internet allows the use of resources, knowledge, software and
Angular.js. The result of this paper is a module for Moodle which data when physical experiments cannot [3].
can simulate experiments based on its configuration.

Keywords—node.js; moodle; javascript; angular.js; php; virtual


laboratory; laboratory;

I. INTRODUCTION
The laboratory is the place where experiments are taken. The
usual experimental process requires that a physical laboratory
exists. It has to be accessible and equipped with the necessary
accessories. In addition, a lab instructor must be also trained to
monitor the progress and accuracy of the experiment. Such
learning process of practical skills could be a little obsolete
because of rapid development new technologies almost in all
areas. The added value of new technologies allows us to create
new things, but it also enables us to make old things much better,
more efficient and more creative. That is why we will try to use
the latest tools for creating a virtual lab in the web environment.
In this way, we will try to bring the user a better experience and
this improve the quality of the learning process [1].
From the students and teachers experience we know that Fig. 1. The difference between a face-to-face and remotely controlled
virtual laboratory can be important part of the learning new experiments
things. Man can learn faster when he tries things several times,
and after that, he understands how it works [2].
In this paper, we discuss the creation of virtual laboratory
The work in this paper brings a new module of activities for (VL). Before we describe the list of technologies to create VL,
the education system Moodle, which will have the character of we must explain what we consider under VL. Generally, we can
virtual laboratory. This module should be able to simulate say that VL is a computer program, where students interact with
different experiments and show the user the results of these the experiment by the computer via the Internet as it is depicted
simulations in a clear manner. in the Fig. 1 [2].
II. VIRTUAL LABORATORIES A typical example is the simulation experiment, where the
At the time when the Internet was not yet widespread in use, the student interacts with the web/app interface. Another possibility
experiments were done in real laboratories. It was important to is a remote-controlled experiment where the student interacts
with the real device via the computer interface, although he can
keep on with different safety regulations to the possibility of
be far away. This is the case when a virtual laboratory turns into
personal injury or damage to equipment. Distance and lack of a remote laboratory.
financial resources make real experiments difficult to perform,
especially in cases where it is necessary to have some advanced When the web excludes the second option, so we have the
and sophisticated tools. Another encountered problem is the following definition: "We call it a virtual laboratory where the
student interacts with the experiment, which is physically at
distant from him or her and not to demand any physical reality".
People often think that the main benefit of a virtual
laboratory is to replace the real one. But it is not. You cannot
replace the experience of the real work with the VL. Although
VL is better than no experience. VL should not be seen as
providing the maximum possible interaction experience.

A. Components of virtual laboratory

There are plenty of existing laboratories, but usually, it is not


possible to guarantee compatibility between them, because there
is not a solid standard. Anyway, it is always possible to identify
the basic components that virtual laboratories can use. Some of
them can be even used more times.
Components:
• The experiment itself.
• The device with possibility to control and acquiring data.
• Laboratory server, which provides control, monitoring Fig. 2. Architecture of StarkLab.
and data processing of the experiment
In the Figure 2, there is an architecture of the researched
• Server providing connection between remote users and virtual laboratory. Individual components can be seen and
laboratory server, usually via the internet 
 labeled with logos for relevant technologies. Angular.js [8]
represents the client part of an application created with
• Web camera connected to a server, which can be used for
remote user as a visual and audible feedback on the actual JavaScript framework. Next the communication between
status of the experiment 
 Angular.js client with server represented by the arrows with the
Socket.io label. It is a real-time event based library. As a server
• Tools enabling multi-user audio, video and chat Node.js server is used, which is a platform based on the
communication 
 JavaScript programming language. But it is for servers, not web
• Client software controlling and representing data of the browser client. This server communicates with the MongoDB
experiment [4]. NoSQL database which stores results from the experiment.
Furthermore, the server communicates with Matlab using
It is important to realize which of these components could be REST webservices, which are also implemented directly in
used, because for a creation of a virtual laboratory it is not Matlab. Finally, Matlab uses Simulink, a Matlab extension,
necessary to have them all. Alternatively, others that are whose role is to simulate an experiment.
perfectly suited for a role can also be used. Sometimes it is used
e.g. database server if experiments will be stored and processed
later. It is also important to realize what type of VL we want to A. Client side component
create. Certainly, differences will be in the design of single-user Client side of the software is created with framework
as opposed to multi-user VL, even with multiple experiments Angular.js. This part of application allows login of users via
simultaneously. It should bear in mind as properly solve the LDAP. Every teacher or student with valid STU account is
scalability, potential safety issues, multi-user access and other allowed to login into StarkLab. After logging in it could be seen
possible issues. web page where theory about experiment is described. At that
time there was only one experiment – simulation of projectile
III. ANALYSIS OF STARKLAB
motion. User is able to insert input parameters for the angle Alfa
At start it was needed to analyze previous work on virtual and velocity v0 of the moving body. After entering these values,
laboratory called StarkLab. Its aim was to create virtual the user is redirected to the page where he is waiting for the
laboratory software based on JavaScript for both client and simulation to begin in the Matlab computing environment.
server side. When Matlab begins to send real-time data to the server,
immediately transmits it to the client. The data can be shown in
tree ways. The first is as point values in the graph, second as
animation and third is all data in table. Upon completion of the
computation and transfer, the user can read these data in the
graph and so can save the result of the simulation to the database
for future viewing.
Fig. 3. Updated architecture.

B. Server side component IV. PROPOSAL OF ARCHITECTURE UPGRADE


The server part is created using Express.js, which is also a According to the previous work about virtual laboratories
JavaScript framework suitable for creating web services that run and the findings from StarkLab analysis, we have decided to
on Node.js. update the architecture for the whole system, which will be
described in the introduction of this chapter.
The server connects the client with the Matlab in way that,
server accepts input values from the client and then runs Matlab This updated architecture should ensure better modularity,
using command line. Matlab immediately starts computation of simple extensible functionality and addition of new experiments.
the experiment and transfers the values to server, which
forwards them to the client in real-time for viewing. The next A. Moodle environment
feature of the server is writing all results to the database. As Because the Moodle system consists of different modules, it
database MongoDB is used. It is NoSQL database that stores will allow us to create our own module of activities. This module
data in the JSON format. has the role of giving participants a role, such as completing a
questionnaire, solving a quiz, etc. In this case, our activity
C. Computional component module will allow experiment simulation based on input values.
Matlab is used as a computing unit in this project, which can It also allows viewing of simulated data. This viewing is
communicate via REST web services to the desired URL. It is provided by a table, animation, and charts of different
very useful because it facilitates the communication between the dependencies.
server and Matlab. After computing new value for trajectory of
the projectile motion it is sent to server using the webwrite() Moodle system is based on PHP programming language, but
function. That function executes the POST request to the server, our activity module loads JavaScript files, so an entire user
where the server receives the data and forward it to the client. interface could be created using Angular.js framework. This is a
nontraditional solution, but we were trying to demonstrate
If Matlab could not provide such a form of communication, another approach of use JavaScript inside Moodle system.
it would be difficult to get data from it. In this way, it can
communicate with any URL.
B. Experiment manager structure was obtained from the moodlehq github respository,
Experiment manager is a very simple user interface designed which contained skeleton to create a new module of activity [7].
for lector managing virtual experiments inside Moodle. It is a
standalone web application that binds to a computing server and
its role is to manage source codes and experiment scripts. Lector
can log in with the same credentials as for Moodle. Also, it is
possible to upload source codes for new experiments, browsing
and searching existing experiments codes and delete old
experiment files if needed. The character of this application is
SPA (single page application).
C. Computation server
The task of the computing server is to mediate the
experiment manager. In this case, it behaves a bit like a web
server, but it is just marginal functionality. The main task is to
accept input values and run them using the Matlab command line
and insert the input value into the interface and run the
simulation itself. This server is waiting while Matlab starts to
return the data from simulation and after that it is sending to the
client which requested the simulation. The server communicates
with the REST web services, Matlab and clients request the
simulation with Socket.io.
D. Matlab
Matlab in our architecture represents the computing power.
Computation is performed using the command line on server
side. Simulated data is forwarded to the specified IP address with
the appropriate port using REST services. The simulations run
in the Matlab section called Simulink.
E. MongoDB database Fig. 4. Project structure of Moodle activity module.

The role of the selected database is to keep records of the In Fig. 4, there is a project structure that already contains
simulated data. These records will be saved in the JSON format. added directories.
Selected parts of the application that communicate with the
database are done using the software drivers. These drivers B. Web interface of Virtuallab
provide database manipulation tools such as search, storing and To create a web interface, the JavaScript framework
deleting items according to the criteria needed. Angular.js was chosen. Fig. 5 shows the simulation input form,
real-time data as table, chart and animation. It is possible also to
F. StarkLab
show previously data from simulation. The data from this table
The full specification and documentation of this virtual can be viewed, downloaded or deleted.
laboratory is in the work [10]. Our interventions in our
application are minimal and their importance is to achieve
compatibility with our computing server, thereby making the
StarkLab web server easier. In Fig. 3 StarkLab is highlighted
because of compatibility with updated architecture.
V. IMPLEMENTATION
After the design of the new architecture, the implementation
phase of the project started, which included the following steps:
• Create a Moodle activity module called Virtuallab.
• Create a web interface for Virtuallab using Angular.js.
• Create a computing server.
Fig. 5. Welcome page of Virtuallab.
• Create an experiment manager.
After submitting the input parameters to the computing
server, the web application switches to the progress section,
A. Moodle activity module where is waiting to get data. As soon as the web application
receives the data from the computing server, the graphs plotting
Each module for Moodle is stored in its directory. This
the data and the table is showed as in Fig. 6.
directory contains a mandatory file structure. This initial
Fig. 8. Experiment manager.

VI. EXTENSIBILITY WITH A NEW EXPERIMENT


In this section it will be described the necessary conditions
the experiment must meet, so that its simulation can be executed
Fig. 6. Progress of the experiment. in our system.

After successfully completing the simulation, the data is Necessary conditions are:
automatically stored in the MongoDB database and is available • Stored on a computing server in a folder with a unique
in the Previous simulations section. The web fragment of this name.
section can be seen on Fig. 7.
• M-file for initialization of input parameters to the
Moodle environment.
• M-file to run the Simulink schema and return output
values.
• Simulink scheme.

The above steps will be described in one of the working


Fig. 7. Previous results section. experiments that can be simulated in the activity module. It is an
experiment called free fall.
C. Computing server
A. Initial parameters of experiment to m-file
The main task of the computing server is to receive input
parameters from the Virtuallab module for simulations, run
these simulations, and return simulated data in real time.
Another minor role of this server is to act as a web server for an
experiment manager. The server was implemented using the
Express.js framework for Node.js technology.
D. Experiment manager
Experiment manager is a client web application created
using Angular.js framework. The options of this app are:
• Upload a new experiment to the server.
• Viewing already uploaded experiments.
• Option of downloading of an experiment.
• Ability to delete the experiment.
• Search experiment by name.
Fig. 8 shows a simple user interface for this application. The
purpose of the green button on the left is to upload new
Fig. 9. M-file script to get parameters.
experiments as zip file to the server. If there is already an
experiment with the same name, this upload will fail. A list of
On rows 5-9 it reads the input values that were sent from the
existing experiments is in the middle. Each experiment contains
client. In this case, height represents the initial height of the
two buttons, the left is for download and the second one for body. The height string must be the same as the string used to
deletion.
configure the activity module inputs. The variable from processing, and allows you to view it in a web browser again in
determines whether this is a request from StarkLab or Virtuallab. a form of a table, chart and animation.
Next, we define the necessary values, in this case the time of
impact. The impact time determines the length of the simulation In the later part of the work, there was a requirement to create
an experiment manager for easier access. Its role is to manage
duration. The last step is to copy the values to the Matlab
workspace, so that they remain in it even when the process is source codes and experiment scripts. This manager simplifies
complete. work for users of the activity module and gives the application a
modern look.
B. Simulation handling m-file
The most used technology in project is JavaScript. This
That file has the code needed to load the simulation scheme, modern programming language has an unbelievable amount of
run the simulation, communicate between Matlab and the use today. Whether on the client side where the Angular.js
computing server, and complete the simulation. It is about the framework was used to create client parts of the activity module
scope of this paper, so for more details, check the page 53 [1]. application and as well as the experiment manager. Its versatile
C. Simulink scheme use was demonstrated by the creation of a computer server that
was responsible for managing the Matlab computing program.
In Fig. 10, it can be seen a simple scheme for simulating free The Node.js JavaScript technology, expanded by Express.js web
fall. The necessary simulation components are: service framework, was used to create this server. JavaScript has
• The Clock controls the time of the simulation. also played a major role in real-time communications across
parts of the system.
• Block for a function where a simulation function is
defined. ACKNOWLEDGMENT
• Scope displays simulated data. This work has been supported by the Cultural and
Educational Grant Agency of the Ministry of Education,
• Real-time pacer ensures soft real-time simulation [9]. Science, Research and Sport of the Slovak Republic, KEGA
030STU-4/2017, KEGA 038STU-4-2018, by the Scientific
All Scopes has to be setup for saving data to Matlab
Grant Agency of the Ministry of Education, Science, Research
workspace in the proper format.
and Sport of the Slovak Republic under the grant VEGA
1/0733/16 and VEGA 1/0819/17.
REFERENCES
[1] J. Hoblik, “Virtual laboratory based on Node.js technology implemented
into Moodle (in slovak),” Master’s thesis, Slovak University of
Technology in Bratislava, 2017.
[2] Stark, E., Bistak, P., Kozak, S., & Kucera, E. (2017, June). Virtual
laboratory based on Node. js technology. In Process Control (PC), 2017
21st International Conference on (pp. 386-391). IEEE.
[3] V. team. (2016) The philosophy of virtual laboratories. [Online].
Available: http://vlab.co.in 

[4] L. Gomes and S. Bogosyan, “Current trends in remote laboratories,” IEEE
Transactions on industrial electronics, vol. 56, no. 12, pp. 4744– 4756,
2009. 

[5] Z. Nedic; J. Machotka; A. Nafalski, “Remote laboratories versus virtual
and real laboratories”, Frontiers in Education, FIE 33rd Annual, 2003.
Fig. 10. Simulink scheme of free fall experiment. [6] SANTANA I.; FERRE M.; IZAGUIRRE E.; ARACIL R.; HERNÁNDEZ
L., “Remote Laboratories for Education and Research Purposes in
VII. CONCLUSION Automatic Control Systems”, IEEE TRANSACTIONS ON
INDUSTRIAL INFORMATICS, VOL. 9, NO. 1., page. 3.
The aim of this paper was to demonstrate updated [7] Moodle team. [online]. [cit: 2017-05-07]. Moodle module; Available on
architecture of StarkLab especially with the activity module for internet: https://github.com/moodlehq/moodle-mod_newmodule.
educational information system Moodle. The purpose of this [8] M. Hevery and team, “Angular framework”, [online]. [accessed on 2016-
module is to simulate experiments in such a way that lector can 03-13]. <http://angularjs.org>
configure instance of this module. Linking this module with any [9] G. Vallabha, “Real-time Pacer for Simulink”, Published in Matlab
experiment which source code and scripts are available is very Central repository, latest version on September 2016.
simple. Lector just has to fill configuration form correctly. [10] Stark, E., Bisták, P., Kucera, E., Haffner, O., & Kozák, Š. Virtual
Additionally, this module can store the simulated data for later Laboratory Based on Node. js Technology and Visualized in Mixed
Reality Using Microsoft HoloLens.

View publication stats

You might also like