Chapter 2. The Moodle System

Now that your Moodle system is up and running, we will be looking at the components that make up the learning platform. Think of these as the foundation on which Moodle is built. The subjects we will cover are:

  • Moodle architecture: In this section, you will learn what the main components of Moodle core are and where its data is stored.
  • Finding your way around in Moodle: Moodle has an intuitive user interface that takes a little time to get used to. You will learn the main navigation and also where to find help if it is required.
  • File management: Dealing with files in web-based applications is not always straightforward. You will learn the different options available to deal with this, which will cover:
    • Moodle's file management
    • Web host file management
    • File management via the File system repository

Moodle architecture

We will first look at the overall architecture on which Moodle is based, before we cover the internal components of the VLE application layer.

The LAMP architecture

Moodle has been developed on the open source LAMP framework consisting of Linux (operating system), Apache (web server), MySQL (database), and PHP (programming language). While Moodle runs on other technology stacks, we will focus on LAMP since it has proven to be the most popular setup among Moodle administrators. Due to the portability of these components and the modularity of Moodle itself (that's what the M stands for), it can support a wide range of operating systems, database systems, and web servers. The following diagram shows a simple overview of the overall architecture:

The LAMP architecture

The lowest level is the operating system. While Linux is the preferred platform, other Unix derivatives such as Solaris and AIX are supported, along with Windows and Mac OS X (preferably the server variants for production sites). Certain libraries will have to be installed; refer to Chapter 1, Moodle Installation.

PHP is the programming language in which Moodle is written (accompanied by HTML, JavaScript, and CSS files). It is the only component that cannot be replaced with any other counterpart.

MySQL is the database of choice for most open source applications, but other database systems such as Microsoft SQL Server, Oracle, PostgreSQL, and MongoDB are fully supported. Some details have been provided in the previous chapter but, as mentioned before, the focus in this book will be on MySQL.

Apache has become the de facto standard for large-scale web applications, closely followed by Microsoft IIS. Both web servers are supported like any others offering PHP support. In this book, we will focus on Apache as it is the most popular option for Moodle setups.

The following diagram shows the interaction of the elements in the Moodle architecture:

The LAMP architecture

The user makes requests via the web browser interface or a mobile Moodle application (for example, to display a learning resource). The web browser passes the request on to the web server(s), which calls the PHP module that is responsible for the call. The PHP module calls the database with an action (query, update, insert, or delete operation) that returns the requested data. Based on this information, the PHP module returns data (usually in the form of HTML or JavaScript code) to the web server(s), which passes the information to be displayed back to the user's browser or application.

The Moodle layer

Now, let's look at the Moodle layer in more detail. Moodle's main building blocks are shown in the following diagram:

The Moodle layer

Moodle distinguishes between code (mostly written in PHP, HTML, and CSS) and data (mostly value added via the Moodle interface).

Moodle libraries, modules (such as resources and activities), blocks, plugins, and other entities are represented in code. It is always stored in the file system in a Moodle directory referred to as dirroot, which has been specified during the installation process in the previous chapter. The code includes all the elements that deal with the backend (server) and frontend (user interface) operations.

Moodle courses, users, roles, groups, grades, and other data such as learning resources added by teachers, forum posts added by students, and system settings added by the administrator are mostly stored in the Moodle database. However, files such as user pictures or uploaded assignments are stored in another Moodle directory, known as moodledata, which is located in a directory called dataroot. Information about files (metadata such as the name, location, last modification, license, and size) is stored in the database, which references the respective files.

Tip

Moodle manages its files internally, and it is important to stress that interfering with any files in moodledata will break the application.

Even copying a file from one folder to another or adding a file manually will break the consistency of your system and further behavior cannot be predicted. Internally, Moodle uses a mechanism called SHA1 hashing. Moodle fully supports Unicode file names and also avoids redundant storage when the same file is used twice (even by different users). Again, you must not modify any Moodle files at system level!

Now let's have a closer look how the Moodle files area—the directory structure—is organized.

Code and data locations

Though Moodle takes care of the organization, of its code and data, it is usually good to know where a file is located in your learning system, for example, when installing add-ons or applying patches.

System files—files that are required to run Moodle—are located in a number of directories under dirroot (the root directory of your Moodle installation):

Directory

Functionality

Chapter number

admin

Moodle administration and some unsupported scripts

All

auth

User authentication plugins

5

availability

Management of availability restrictions

-

backup

Backup and restore operations

13

badges

Management of badges

9

blocks

Blocks placed in courses and the front page

7

blog

Internal and external blogging functionality

9

cache

Cache stores and performance scripts

12

calendar

Calendar and event management

9

cohort

Handling of site-wide groups (cohorts)

4

comment

Comments used in courses

9

completion

Course completion criteria and aggregation methods

-

course

Management of courses and categories plus course formats

4

enrol

User enrolment plugins

4

error

Error handling; mostly used by developers

-

files

File management

2

filter

Moodle filters applied to text authored in the editor

7

grade

Grade and grade book management as well as reports

9

group

Groups and groupings handling

4 and 5

install

Moodle installation and update scripts

1

iplookup

Look up of IP addresses

-

lang

Localization strings; one directory per language

9

lib

Libraries of core Moodle code

2

local

Recommended directory for local customizations

14

login

Login handling and account creation

5

message

Messaging tool supporting multiple channels

9

mnet

Peer-to-peer and hub networking

16

mod

Core Moodle course modules

9

my

Users' personal dashboards, known as MyMoodle

7

notes

Handling of notes in user profiles

11

pix

Generic site graphics

-

plagiarism

Plagiarism detection plugins

8

portfolio

Portfolio plugins allowing users to export data

8

question

Question and question bank handling plus question types

9

rating

Ratings used in forums, glossaries, and databases

-

report

Report plugins and events list

10

repository

Repository plugins allowing users to import and load data

8

rss

RSS feeds

9

tag

Tagging

9

theme

Themes to change branding of site

7

user

User management

5

userpix

Displays thumbnails of all user profile pictures

5

webservice

Web services functionality

15

The moodledata directory (dataroot) is organized as follows:

cache

Caching data

filedir

That is the actual user content—files that have been uploaded

filter

Caching of filtered data

lang

Locally used language packs and customizations

localcache

Caching data of plugins

lock

Locked files

muc

Moodle Universal Cache files

repository

External location accessible from within Moodle (see the File management via the file system repository section)

sessions

Session information

temp

Temporary files

trashdir

Deleted files

If problems occur before carrying out an update, it is sometimes necessary to delete caching data and any temporary information Moodle has created. This data is located in the respective directories in the structure shown in the preceding table. In other words, once everybody has logged out, you can safely delete any files in the directories named cache, filter, localcache, lock, muc, sessions, temp, and trashdir. This can either be done manually or, better, via Development | Purge all caches in the Moodle interface, which we will cover next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.68.18