An analogue of Moodle, or as a law teacher, he created his own distance learning system. Part 1. Beginning
Disclaimer: the distance learning system (DLS) is currently put into operation (production), approved, tested and is successfully operating. System free, is open source and posted on GitHub repository… In terms of the technology stack, it is built on the Laravel 8.0 (PHP 7.4) framework using libraries and other packages (programs): React (redux + router), SocketIo, Docker, NodeJs, Rest API, WebRTC, Leaflet, etc.
In a series of articles, I will tell you how the system works, what I had to go through while developing it, and what problems I had to solve.
The unique features of the system include:
Internal anti-plagiarism. In the course of conducting classes, we faced the problem of students copying solutions to tasks from each other. In manual mode, it is quite difficult to track the degree of coincidence of solutions, and therefore a system has been developed showing the percentage of “similarity” of answers.
Identification of technical methods to improve the uniqueness of the text. To increase the efficiency of checking works and detecting attempts to use various methods of increasing uniqueness, a system has been developed to identify signs of suspicious interference with the text.
In addition to the standard verification algorithms (tests, document verification, chats, etc.), the following have been implemented:
a. Quest. The visual quest designer allows you to implement almost any kind of tasks in the form of a game.
b. Dialogue system. In the design mode, a tree of questions and answers is created that allow you to non-linearly solve individual problems (conversation, interrogation, algorithm of actions, etc.)
c. Portfolio. To account for additional work, additional assessment categories have been created (science, creativity, layout, etc.).
Analysis of the text of the answers. Automatic verification of texts and procedural documents allows you to save the teacher’s time and identify poor-quality answers.
Internal self-test. Users can create tasks themselves and cross-check each other’s tasks. Own algorithm for comparing students’ decisions in order to exclude repetitions (duplication) of answers. You can call it your own internal anti-plagiarism.
Virtual whiteboard… To demonstrate documents, presentations, text and photographs to all participants, as well as to conduct a blitz survey on the topic, a board was created that allows the organizer to see and automatically check the answers to tasks online, as well as enable / disable the visibility of the correct answer by users, the visibility of the answer other participants.
Online support. Real-time monitoring of user-opened pages allows for more efficient support.
Gps… To implement creative ideas, an interactive map has been created, on which users are marked in real time and their movement in the field.
Video communication… For remote interaction, a video communication system is used, which allows demonstrating sound and image from a web camera, or the organizer’s screen.
Telegram Bot… A telegram bot will automatically notify you of incoming messages.
Having a higher legal education and having worked for several years as a practicing specialist, life has developed in such a way that I began to work as a teacher in an educational organization at the department of legal profile. Previously, I did not have to think about my own distance learning system – there was enough time for face-to-face classes. However, after a lapse of time (about 5 years), it turned out that there is much more knowledge that I would like to transfer to students than the curriculum allows.
A review of the existing and most common CMS such as WordPress and Joomla showed that they solve slightly different tasks and out of the box do not have the functionality I need. Installing the necessary plugins, packages and extensions at that moment seemed an impossible task from the point of view of understanding the work of all this in a complex and expanding its own functionality.
I also refused to install and use Moodle due to the complexity of understanding at that time its installation, use and cumbersomeness, even ready-made virtual machines were not considered. I wanted to do something of my own so that it would work quickly with a full understanding of the principles of work and further improvement.
It was decided to create their own system from scratch. The first version of the system was written in PHP and JQuery using the MySql interface for accessing the database, all the material was found on the Internet and by copying the code fragment by fragment, a system was made that allows it to somehow support and expand its functionality.
The shortcomings of this approach were discovered quite quickly, starting from the simplest SQL injections like “1 = 1” that were used to delete the database and the realization that working with procedural code is fraught with many problems in the form of poor support, confusion and code duplication.
Having decided that it was necessary to study modern patterns and design patterns, I settled on the task of creating my own CMS using the MVC and OOP design pattern. Routing was done very primitively: the URI address was processed using regular expressions, the corresponding controller class was called manually (with its own autoload), which in turn called the settings, model and template classes. The system has become more structured and modern. The PDO interface was used to access MySql. The class of each model inherited from the base class, which was connected to the base in the constructor using the singleton template and returned information in an associative array (flag PDO :: FETCH_ASSOC). In the base class, methods were created that vaguely resemble an attempt to implement your own ORM in the form of a CRUD. The structure of the database itself was very ill-conceived: the tasks table contained redundant information about the topic, the task itself, the author, etc.
The database queries looked pretty bad. An example of a request for a choice of solutions:
$decisions = $model->findBySql("SELECT *, d.id as did, t.login as tlogin, d.login as login FROM decisions as d, tasks as t WHERE ((d.id_task = 0 and t.number_razdel = d.number_razdel and t.number_task = d.number_task) or (t.id=d.id_task)) and t." . $route['discipline'] . " = 1 and d.login IN ('" . implode("','", $arr_users) . "')", );
$ decisions = $ model-> findBySql (“SELECT *, d.id as did, t.login as tlogin, d.login as login FROM decisions as d, tasks as t WHERE ((d.id_task = 0 and t.number_razdel = d.number_razdel and t.number_task = d.number_task) or (t.id = d.id_task)) and t. “. $ route[‘discipline’] … “= 1 and d.login IN (‘”. Implode (“‘, ‘”, $ arr_users). “‘)”, );
Further improvement of the system was the introduction of composer, the creation of an advanced autoloader and namespace. There was also a transition to PhpStorm (teaching license) and OpenServer.
The frontend was also actively developing. Initially, all the logic for building html was built using PHP itself as a template engine, only in some parts of the code was jQuery used for animation and visual effects. Later, third-party libraries were connected TinyMCE (visual editor for content editing), ResponsiveFilemanager (for working with the file system), Bootstrap… The functionality of the system was carried out using classic POST and GET requests with parameters (no encryption systems, no tokens were used), later I came to the widespread implementation of ajax, fetch, axios, but that was later.
Quite quickly, I abandoned this idea, first of all, for the above reason, and also because of the complexity of creating projects by other users, the need to re-convert the presentation into a quest at the slightest fixes, the absence of normal feedback from the iframe through the main window, etc. …
As a result, it turned out, as it seemed to me, a good application that was connected to include on the site page and even worked as I needed. I attach screenshots of the first version. The undoubted advantage was the ability not to use bundlers such as Webpack, but simple editing of the code right on the server.
At that moment, I practically did not use the npm or composer libraries, so I wrote code both at home and at work, and exchanged files using YandexDisk. This did not cause any discomfort. I knew there was a git, but I didn’t know why I needed it.
The problems of running a SPA application without using libraries include the cluttered DOM tree, since all data was stored in data attributes, the complexity of the code readability, everything was stored in the database in a serialized JSON format, a lot of promises implemented in async await functions, which are not always worked as I needed, there was almost no mechanism for handling errors and exceptions. But everything seemed to work and complete the tasks.
End of Part 1.
If the topic is interesting, then I will continue the story (the following works in the current system):
Part. 2. Creation of API for SPA, solving problems with cross-site requests, validation, socket injection, problems of choosing a PHP framework.
Part. 3. How I switched to Laravel and how it turned out to be worse than a self-written framework.
Part 4. Moving to ReactJs, introducing flux, SOLID and integrating into Laravel.
Part. 5 Training through interactive GPS maps, why Docker was needed, the transition to OSM and OSRM.
Part. 6. Parsing of docx documents, internal anti-plagiarism, identification of technical methods to increase the uniqueness of the text.
Part. 7. Implementation of neural networks in the work of the LMS.