Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Moodle 4 Administration

You're reading from   Moodle 4 Administration An administrator's guide to configuring, securing, customizing, and extending Moodle

Arrow left icon
Product type Paperback
Published in Oct 2022
Publisher Packt
ISBN-13 9781801816724
Length 640 pages
Edition 4th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alex Büchner Alex Büchner
Author Profile Icon Alex Büchner
Alex Büchner
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Chapter 1: Installing Moodle 2. Chapter 2: Exploring the Moodle System FREE CHAPTER 3. Chapter 3: Exploring Courses, Users, and Roles 4. Chapter 4: Managing Courses and Enrolments 5. Chapter 5: Managing Users, Cohorts, and Authentication 6. Chapter 6: Managing Permissions, Roles, and Capabilities 7. Chapter 7: Enhancing Moodle’s Look and Feel 8. Chapter 8: Understanding Moodle Plugins 9. Chapter 9: Configuring Educational Features 10. Chapter 10: Configuring Technical Features 11. Chapter 11: Enabling Mobile Learning 12. Chapter 12: Gaining Insights through Moodle Reporting and Analytics 13. Chapter 13: Ensuring Moodle Security 14. Chapter 14: Complying with Data Protection Regulations 15. Chapter 15: Optimizing Moodle Performance 16. Chapter 16: Avoiding Sleepless Nights – Moodle Backup and Restore 17. Chapter 17: Working with Moodle Admin Tools 18. Chapter 18: Integrating External Systems Using Moodle Web Services 19. Chapter 19: Setting Up Moodle Networking 20. Chapter 20: Supporting Multi-Tenancy 21. Index 22. Other Books You May Enjoy Appendix: Configuration Settings

File management in Moodle

This section is all about files: how to access them, how they are organized in folders, how to upload them, how to configure private files, the difference between copying and linking, file types, increasing the upload file limit, and how to deal with deleted files via the recycle bin. This is a lot to take in, so let’s get started.

Dealing with files in web-based applications is not always straightforward. While Moodle provides a user interface to perform this task, it is sometimes necessary that, as the administrator, you will have to bypass this mechanism and use other means. First, let’s look at the built-in file handling that students and teachers also use.

Moodle file management interface

Moodle offers a basic file management interface that lets you upload, move, delete, and rename files and directories. It is also possible to copy or link to files from third-party services such as Dropbox; on the same note, Moodle isn’t a content management system.

We have already talked about how Moodle stores files at the system level—the ones we shouldn’t touch! At the application level, it arranges files according to Moodle’s structure:

Important note

In Moodle, a file is always connected to the particular bit of Moodle that uses it.

Figure 2.10 – Moodle files

Figure 2.10 – Moodle files

Files are organized in a tree-like structure, which has three types of main branches:

  • Categories/Courses/Activities and Resources
  • Users (private files and personal backups)
  • Site home (Moodle’s front page)

We will be dealing with all those concepts at later stages, so, for now, let’s just take them for granted. Courses are arranged in categories (and subcategories) and consist of activities and resources, and there are usually further subdirectories inside activities and resources.

There are multiple users on your system, each with a dedicated file area that can be accessed from anywhere in Moodle, but there is only a single Site Home. Remember, a file is always connected to the particular bit of Moodle content that uses it, reflected by the directory-like structure:

Figure 2.11 – Moodle folders

Figure 2.11 – Moodle folders

Now that we know how files and folders are organized, let’s look at how to upload data and create directories.

Uploading files

Uploading files usually takes place via drag and drop. While this feature is vital for learners and trainers, as an administrator, you will also have to upload files from time to time, for instance, uploading users in batch mode via a CSV file.

Adding single or multiple files is straightforward: simply select the files in your Explorer (Windows) or Finder (Mac) and drag them onto the provided area inside the dotted lines shown in the following screenshot:

Figure 2.12 – Moodle files and folders

Figure 2.12 – Moodle files and folders

When you click on a file once it has been uploaded, you have the option to Download or Delete the file. If the selected file is a compressed archive, you have the option to Unzip it. Additionally, meta-information about the file (name, author, license, path, icon, last modified, created, and size) is displayed at the bottom of the window, as shown in the following screenshot:

Figure 2.13 – Moodle file details

Figure 2.13 – Moodle file details

For some file operations, it is necessary to use the File picker, a tool utilized whenever files have to be added to a particular object in Moodle. A user can choose from multiple file sources, known as repositories. The File picker can be accessed using the Add… button at the top left of the files area. We will be dealing with repositories in Chapter 10, Configuring Technical Features.

Closely related to uploading files is configuring the upload limit.

Upload limit

Your site has a file upload limit set to 2 MB by default. If you need to support files larger than the 2 MB threshold, you will have to increase the limit.

In your php.ini file (find its location using the php -i command and locate the Loaded Configuration File entry), modify the following two lines; <value> represents the maximum limit (multiple input formats are supported, for example, 20M or 20971520):

  • upload_max_filesize = <value>
  • post_max_size = <value>

If you don’t have access to the php.ini file, create a .htaccess file in your main Moodle directory and add the following two lines:

  • php_value upload_max_filesize = <value>
  • php_value post_max_size = <value>

You will also have to increase the LimitRequestBody parameter on some systems, usually found in the Apache httpd.conf configuration file. You may also need to modify your database configuration, such as the max_allowed_packet size:

Figure 2.14 – Moodle upload limit

Figure 2.14 – Moodle upload limit

Once these changes have been applied, ensure the Maximum upload file size parameter under Site administration | Security | Site security settings has been set to Site upload limit. You can also change the user quota for private files via the Private file space parameter. When changing these two values, bear in mind that they will potentially impact the bandwidth and disk space, respectively.

For very large files such as high-quality learning resources, it would be helpful to be able to upload the content via (secure) FTP and then use the built-in unzip functionality in the File picker. However, it is not possible to upload files directly via FTP. Instead, you have to make use of the filesystem repository, which will be discussed in detail in Chapter 10, Configuring Technical Features.

Now that you are familiar with uploading files, let’s deal with personal files that belong to individual users.

Private files

Every user has an area where personal files can be stored and managed. These are only visible to the user to whom the private files belong. Any item stored in this protected area can be used throughout the site. Private files can be accessed via the File picker, the Private files block, or directly via the Private files link in the user menu:

Figure 2.15 – Moodle File picker

Figure 2.15 – Moodle File picker

Handling files and directories is identical to handling other files. However, you might have spotted the Link icon in the PDF file in the preceding screenshot, which leads us nicely to the following subsection.

To link or to copy?

By default, files in Moodle are copied. When you add a file from a source (for instance, your computer or your private files), it will be copied, which means that the source and the resulting file will be logically separated. For example, if you have stored an image in your private files and you use this in three different courses, there are three logical copies. The three images will not be affected if you change the source in your private files.

Moodle also supports linking files, also known as file aliases. Let’s stick to the same example, but this time round, the three images are linked. If the source is changed, the three files in the courses will also have changed. Beware that there are some access restrictions with linked files; for example, instructor A might not be able to link to instructor B’s file.

When you select a file from a source (repository) that supports linking, an option is provided to Link to the file:

Figure 2.16 – Moodle files – copy and link

Figure 2.16 – Moodle files – copy and link

Moodle keeps track of linked files and guarantees that inconsistencies cannot occur:

  • When deleting a linked file, copies of the file will be created for each link
  • When a linked file is overwritten, all links are updated
  • When a file overwrites a link, the files are “separated”

Linking and copying are about how files are being dealt with internally; next up are file types, which dictate how they are dealt with when users download them.

File types

Moodle does not restrict which types of files users can upload, for instance, an assignment in a course. Moodle comes with predefined values for the most popular file types in terms of the icon displayed and the program that will be opened, for example, PDF files or PowerPoint documents. However, as depicted in the following screenshot, you can add new file types and view, modify, and delete existing file types by going to Site administration | Server | File types:

Figure 2.17 – Moodle file types

Figure 2.17 – Moodle file types

When you add a new file type via the button at the bottom of the screen, you must provide the file’s Extension and its MIME type. Furthermore, you have the option to select File icon, Type groups (such as image or document), Description type, Custom description (if Description type is Custom description specified in this form), Alternative language string (if selected in Description type) and Default icon for MIME type.

So far, we have covered how files are stored, organized, and added to Moodle. Now, let’s look at what happens when files are deleted (by accident).

You have been reading a chapter from
Moodle 4 Administration - Fourth Edition
Published in: Oct 2022
Publisher: Packt
ISBN-13: 9781801816724
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime