Course files: Difference between revisions

From MoodleDocs
m (clean up, typos fixed: recently- → recently , eg → e.g. (4))
 
(23 intermediate revisions by 11 users not shown)
Line 1: Line 1:
This page talks about the legacy "Course files" area in Moodle 2, and related topics.
{{Working with files and folders}}
This page explains the legacy "Course files" area in Moodle 2, and related topics.


It's useful for any teacher who wants to know how to add files to a Moodle 2.0 course (especially if you previously used Moodle 1.9 or earlier).
It's useful for any teacher who wants to know how to add files to a Moodle 2 course (especially if you previously used Moodle 1.9 or earlier).


==Files in Moodle 1.9==
==Files in Moodle 1.9==


In versions of Moodle before 2.0 all the files uploaded into Moodle were stored in a physical directory on disk known as the 'Course Files' area.   
In versions of Moodle before 2, all the files uploaded into Moodle were stored in a physical directory on disk known as the "Course files" area.   


This is where a teacher might upload files to be part of the course content, but this area also included everything students uploaded, such as assignments and forum attachments.  These "activity files" were stored in a special folder called "moddata" in a certain structure that helped modules keep track of their own files.
This is where a teacher might upload files to be part of the course content, but this area also included everything students uploaded, such as assignments and forum attachments.  These "activity files" were stored in a special folder called ''moddata'' in a certain structure that helped modules keep track of their own files.


===Typical Moodle 1.x workflows===
===Typical Moodle 1.x workflows===
Line 22: Line 23:
# Select the PDF from the course files
# Select the PDF from the course files


Students did not have direct access to read the course files area, all they could do is upload files from their desktop computer straight into activities.
Students did not have direct access to read the course files area. All they could do was upload files from their desktop computer straight into activities.
 


===A less typical workflow===
===A less typical workflow===


# Use FTP to push files straight into the course files area
# Use [[wikipedia:FTP|FTP]] to push files straight into the course files area
# Add resources to the course using these files  
# Add resources to the course by selecting these files
# Update the resources later by updating the files directly via FTP
# Update the resources later by updating the files directly via FTP


This meant expert users could update course content with files or HTML mini-sites without having to touch the web interface.
This meant expert users could update course content with files or HTML mini-sites without having to change anything in Moodle.
 


===Problems with the Moodle 1.x model===
===Problems with the Moodle 1.x model===


* If the original file is deleted or renamed from Course Files then it breaks everywhere it was being shown
* If the original file was deleted from course files area, or renamed, it would result in broken links everywhere where it was previously used
* Storing files on disk meant names were restricted (eg Japanese names would break on some operating systems)
* Storing files on disk meant file names were restricted (e.g. file names in Japanese would break on some operating systems)
* All Course Files had to be readable by students (if they knew the URL) because Moodle had no way of telling what context you were viewing a file in (eg the same file might be in a HTML text in a forum and also in a resource).  This meant that files stored here were not as secret as teachers thought they were.
* All course files had to be readable by students (if they knew the URL) because Moodle had no way of telling what context you were viewing a file in (e.g. the same file might be in a HTML text in a forum and also in a resource).  This meant that files stored in the course files area were not as secret as teachers thought they were.
* You could not re-use an upload in multiple courses, you had to upload it to each course over and over
* Files could not be reused in several courses - that had to be uploaded to each course files area
* Backups had to include ALL course files, just in case they were required, even if the backup only contained one activity
* Backups had to include ALL course files, just in case they were required, even if the backup only contained one activity
* Media might appear to teachers sometimes and look fine, but others would not see it (eg course descriptions)
* Images and other media might look fine for teachers, but others would not see it (e.g. in course descriptions)
* When copying (importing) activities from one course to another it was impossible to tell all the media that should be imported with it
* When importing activities from one course to another, ALL course files were imported, as it was impossible to tell which files were needed


==Files in Moodle 2 ==


==Files in Moodle 2.0==
In Moodle 2 the files work a lot more like Web 2.0 systems, such as Facebook and Google Docs.


In Moodle 2.0 the files work a lot more like Web 2.0 systems (eg Facebook or Google Docs).
Each activity and each text has its own file area, and files are associated directly with the place it is used. For example, a file attached to a forum post is stored "with" the forum post, and becomes subject to exactly the same access restrictions.


Each activity and each text has its own file area, and files are associated directly with the place it is used.  For example, a file attached to a forum post is stored "with" the forum post, and becomes subject to exactly the same access restrictions.
The Files system is intimately connected with the Repository system, and a file picker which makes it easy to browse external and internal repositories for files, and then copy them into Moodle.  Certain repositories also allow you to link directly to their media files.  Repositories in general are the way of the future for content - most Web 2.0 systems are really repositories of data with various management interfaces.


The Files system is intimately connected with the Repository system, and a File Picker which makes it easy to browse external and internal repositories for files, and then copy them into Moodle.  Certain repositories also allow you to link directly to their media files.  Repositories in general are the way of the future for content - most Web 2.0 systems are really repositories of data with various management interfaces.
A private files area is provided for each user to store a collection of files for their own use.  This is useful for students as well as teachers, and makes it easy to re-use media across the Moodle siteOnly you can access your own private files.


A Private Files area is provided for each user to store a collection of files for their own use. This is useful for students as well as teachers, and makes it easy to re-use media across the Moodle site.  Only you can access your own private files.
The course files area in Moodle 2 is [[wikipedia:Deprecation|deprecated]] and is not available by default due to the problems described above. When a site is upgraded from 1.9, all course files are migrated into new file areas and the old course files area is hidden from view.


The Course Files area is deprecated and off by default (see Moodle 1.x Problems described above).  During an upgrade from 1.9 all Course Files are migrated into new file areas and the Course Files area is hidden from viewSee the discussion below about what happens if you want to continue using it.
Internally, files are stored in a "file pool" of blobs on disk with numbers for namesAll the actual names and metadata are stored in a database.


Internally, files are actually stored in a "file pool" of blobs on disk with numbers for names.  All the actual names and metadata is now stored in a database.
===Typical Moodle 2 workflow===


===Typical Moodle 2.0 workflow===
# Edit a text or activity
# Use the filepicker to select the file from a local or remote repository


Edit a text or activity
The file is then copied to Moodle and stored securely with the text or activity.
Start inserting some media or a file
Use the filepicker to easily select the file from any local or remote repository
The file is copied to Moodle and stored securely with the text or activity


===More advanced Moodle 2.0 workflow===
===More advanced Moodle 2 workflow===


Edit a text or url module
# Edit a text or url resource
Start inserting some media or a file
# Use the filepicker to select the file from a local or remote repository and select "link"
Use the filepicker to easily select the file from any local or remote repository and select "link"
The file URL is embedded into the text and when viewed, the media comes directly from the open repository.


The file URL is then embedded into the text and when viewed, the media comes directly from the repository.


===Why is it better?===
===Why is it better?===
Line 78: Line 75:
====Integrity====
====Integrity====


If the forum post with embedded media files (eg images) is copied to another course, then the files move with it.  Anyone in the new course will also see the media files.   This makes activities more portable and re-usable.
If a forum post with attached files (e.g. images) is imported into another course, then the files move with it.  Anyone in the new course will also see the files. This makes activities more portable and re-usable.


If two activities use the same file and one is deleted, then the other one is not affected.
If two activities use the same file and one is deleted, then the other one is not affected.


There should be less errors where everything looks fine to teachers and is broken for students.
There should be fewer problems where everything looks fine for teachers but doesn't appear for students.


====Security====
====Security====


Access to files is governed the same way as the items that they attached to, which is what people expect. All files are now controlled by the settings in the usual Moodle interface, including roles and permissions.
Access to files is governed the same way as the items that they attached to, which is what people expect. All files are now controlled by the settings in the Moodle interface, including roles and permissions.


====Re-use====
====Re-usability====


It is now fast and easy to re-use files across Moodle.  Using the File picker you can choose a file you recently used, or one from any course you have access to.
It is now fast and easy to re-use files across Moodle.  Using the file picker, a recently used file may easily be chosen, or a file from any course a user has access to.


====Backups====
====Backups====


Backups of activities are now small, accurate and easier to handle, because we know exactly what files to include.  This is important for things like Community hubs, where sharing of courses and parts of courses will become more common, and sharing every file you have in a course is often not acceptable.
Backups of activities are small and accurate, because Moodle detects exactly what files to include.  This is important for things like [[Community hubs]], where sharing of courses and parts of courses will become more common, and sharing every file in a course may be inappropriate.
 
====Internationalization====


====Internationalisation====
There are no restrictions on file names - even files with names in Japanese may be used.


We are no longer restricted by the operating system, we can use files with any names we like.
====Repositories====


==How to duplicate Moodle 1.x functionality==
The world is turning towards better management of files and less "dumping" of files into disks.  There are many repository solutions out there that focus on better management of files, with versioning, workflow, metadata and other features.


===FTP files into Moodle===
===How to duplicate Moodle 1.x functionality in 2===


===Change a file once, have it update in many places===
If you really want to mimic older workflows in 2 then there are some solutions, although none of them are exactly the same.


====FTP files into Moodle====


==Roadmap for future improvements==
# One way to do this is via the [[admin/repository/filesystem|File system repository]].  This allows you to turn a directory on the server into a repository of files within the Moodle file picker.  You can then use any server technology to access that directory from a desktop, such as FTP, [[wikipedia:Samba (software)|Samba]], [[wikipedia:AppleShare|Appleshare]] or [[wikipedia:WebDAV|WebDAV]].
# See the direct WebDAV plans below.


===Synch files===
====Change a file once and have it update in many places====


# See [[Working with files]] for the areas  in which this is possible.


===Linking ability to filesystem repository===
===WebDAV support for course files and user files===


==See also==
This would effectively replace direct FTP access to the file system with WebDAV access to the "virtual" file system inside these file areas in Moodle. It would allow people to update files without going near the web GUI.


* MDL-23306
[[fr:Fichiers de cours]]
[[ja:コースファイル]]
[[de:Kursdateien]]
[[es:Archivos de curso]]

Latest revision as of 15:29, 22 September 2021

This page explains the legacy "Course files" area in Moodle 2, and related topics.

It's useful for any teacher who wants to know how to add files to a Moodle 2 course (especially if you previously used Moodle 1.9 or earlier).

Files in Moodle 1.9

In versions of Moodle before 2, all the files uploaded into Moodle were stored in a physical directory on disk known as the "Course files" area.

This is where a teacher might upload files to be part of the course content, but this area also included everything students uploaded, such as assignments and forum attachments. These "activity files" were stored in a special folder called moddata in a certain structure that helped modules keep track of their own files.

Typical Moodle 1.x workflows

The course files area was accessed in two ways through the Moodle interface by teachers.

  1. Through the "Files" link in the Course Administration block, or
  2. When a file was required in other places, such as a resource, or attachment.

When publishing a file as a resource, say a PDF file, a teacher might:

  1. Upload it to their course files area along with all the other files they intend to use in the course
  2. Add a resource to the course
  3. Select the PDF from the course files

Students did not have direct access to read the course files area. All they could do was upload files from their desktop computer straight into activities.

A less typical workflow

  1. Use FTP to push files straight into the course files area
  2. Add resources to the course by selecting these files
  3. Update the resources later by updating the files directly via FTP

This meant expert users could update course content with files or HTML mini-sites without having to change anything in Moodle.

Problems with the Moodle 1.x model

  • If the original file was deleted from course files area, or renamed, it would result in broken links everywhere where it was previously used
  • Storing files on disk meant file names were restricted (e.g. file names in Japanese would break on some operating systems)
  • All course files had to be readable by students (if they knew the URL) because Moodle had no way of telling what context you were viewing a file in (e.g. the same file might be in a HTML text in a forum and also in a resource). This meant that files stored in the course files area were not as secret as teachers thought they were.
  • Files could not be reused in several courses - that had to be uploaded to each course files area
  • Backups had to include ALL course files, just in case they were required, even if the backup only contained one activity
  • Images and other media might look fine for teachers, but others would not see it (e.g. in course descriptions)
  • When importing activities from one course to another, ALL course files were imported, as it was impossible to tell which files were needed

Files in Moodle 2

In Moodle 2 the files work a lot more like Web 2.0 systems, such as Facebook and Google Docs.

Each activity and each text has its own file area, and files are associated directly with the place it is used. For example, a file attached to a forum post is stored "with" the forum post, and becomes subject to exactly the same access restrictions.

The Files system is intimately connected with the Repository system, and a file picker which makes it easy to browse external and internal repositories for files, and then copy them into Moodle. Certain repositories also allow you to link directly to their media files. Repositories in general are the way of the future for content - most Web 2.0 systems are really repositories of data with various management interfaces.

A private files area is provided for each user to store a collection of files for their own use. This is useful for students as well as teachers, and makes it easy to re-use media across the Moodle site. Only you can access your own private files.

The course files area in Moodle 2 is deprecated and is not available by default due to the problems described above. When a site is upgraded from 1.9, all course files are migrated into new file areas and the old course files area is hidden from view.

Internally, files are stored in a "file pool" of blobs on disk with numbers for names. All the actual names and metadata are stored in a database.

Typical Moodle 2 workflow

  1. Edit a text or activity
  2. Use the filepicker to select the file from a local or remote repository

The file is then copied to Moodle and stored securely with the text or activity.

More advanced Moodle 2 workflow

  1. Edit a text or url resource
  2. Use the filepicker to select the file from a local or remote repository and select "link"

The file URL is then embedded into the text and when viewed, the media comes directly from the repository.

Why is it better?

Integrity

If a forum post with attached files (e.g. images) is imported into another course, then the files move with it. Anyone in the new course will also see the files. This makes activities more portable and re-usable.

If two activities use the same file and one is deleted, then the other one is not affected.

There should be fewer problems where everything looks fine for teachers but doesn't appear for students.

Security

Access to files is governed the same way as the items that they attached to, which is what people expect. All files are now controlled by the settings in the Moodle interface, including roles and permissions.

Re-usability

It is now fast and easy to re-use files across Moodle. Using the file picker, a recently used file may easily be chosen, or a file from any course a user has access to.

Backups

Backups of activities are small and accurate, because Moodle detects exactly what files to include. This is important for things like Community hubs, where sharing of courses and parts of courses will become more common, and sharing every file in a course may be inappropriate.

Internationalization

There are no restrictions on file names - even files with names in Japanese may be used.

Repositories

The world is turning towards better management of files and less "dumping" of files into disks. There are many repository solutions out there that focus on better management of files, with versioning, workflow, metadata and other features.

How to duplicate Moodle 1.x functionality in 2

If you really want to mimic older workflows in 2 then there are some solutions, although none of them are exactly the same.

FTP files into Moodle

  1. One way to do this is via the File system repository. This allows you to turn a directory on the server into a repository of files within the Moodle file picker. You can then use any server technology to access that directory from a desktop, such as FTP, Samba, Appleshare or WebDAV.
  2. See the direct WebDAV plans below.

Change a file once and have it update in many places

  1. See Working with files for the areas in which this is possible.

WebDAV support for course files and user files

This would effectively replace direct FTP access to the file system with WebDAV access to the "virtual" file system inside these file areas in Moodle. It would allow people to update files without going near the web GUI.