Improved quota system
From Dokeos
This page describes the design for a new feature, which is an improvement of an existing one. Platform administrators want to set a base quota for all courses, e.g. 50 Megabyte by default, and course administrators can ask for more with a well-motivated request. The quota can then be adjusted for each individual course. Others have asked for an even more detailed quota system, e.g. the ability to set a quota per user.
This feature is available starting from Dokeos 1.6.
Contents |
Situation before the changes
Quota can be set for the documents tool and the group documents tool. A 10 Megabyte quota for the documents tool means the teacher cannot upload a new file if that would mean the total size of all files in the documents tool would exceed 10 Megabyte.
Current situation
The first improvement suggested on this page has been implemented. There is a default quota setting for the documents tool and the group documents tool. In addition, the quota for the documents tool can be adjusted for each individual course: one course can have a maximum of 4 Megabyte, another course can have a maximum of 200 Megabyte.
Quota can be adjusted by the platform admin, in the Admin Courses module, by editing the settings of a course.
Course admins can see their quota and how much they have left in the documents module, there is a link under the list of documents.
What do we measure
Currently there is only a quota on files, not database size. This means a teacher can have an unlimited number of announcements, agenda items, etc. This is not as bad as it seems: the file size usually exceeds the database size by a significant margin. Is this still acceptable?
First improvement
We want to be able to set a quota limit for each individual course. This can be implemented rather quickly.
Software design
We need
- quota per course
- admin interface for administering this quota: looking it up for a certain course, changing it...
- some method through which course admins can ask for more quota
Quota per course
M = Megabyte
We assume the new quota only counts for the normal documents tool. (Reminder: in the future, it's possible that all documents will be stored in this tool). We keep the base limit in the document.php and groupdocument.php.
Quota setting
We have to store a quota setting for each course; there already is a field called diskQuota in the course table. The default quota is 20 M (this has to be conservative I feel, individual syadmins can always increase the default setting). When a course is created, the diskQuota field is set to the normal "base" quota described in the document.php.
Code check of quota
The document.php code only needs to check the current size of the directory against the course table quota field. However, if this would be empty or NULL, we will use the base quota as default. The code for this check is a relatively simple function, that we will store as a start in the new document.lib.php library.
Admin interface
Further improvements
The improvements suggested below will take more time to implement, we first have to discuss what exactly we want.
Discussion: do we want quota
- per user, e.g. "user Mrs Example is allowed 50 M total in this Dokeos installation"
- per course, e.g. "course LUNA101 is allowed 50 M"
- per user per course, e.g. "user Mrs Example is allowed 50 M in course LUNA101"
- a combination of the above
Storage per user
This system seems the most fair because every person gets the same amount of storage. However, this will also require the most extra code. Imagine the case where a teachers wants students to hand in an assignment, and their quota is not big enough: this requires an admin interface to adjust many users' quota at once: per group, per class...
Storage per course
This system is the simplest to implement. As advantages this has that it is simple and straightforward. A course has quota, you can upload and create files until this quota is exceeded. Simple. However, it might cause problems because students and teachers share the same course folder for storage. Students can fill up part of the course quota, which the teacher might feel is his/her quota.
Storage per user per course
Other proposal
Each student gets X MB for a course - dropbox and group document files count against this. The professor gets an additional Y, so the limit for the course is Y+N*X, where N is the number of students.
This can be seen as the same as the storage per user per course case, with quota Y for a teacher and quota X for the students.
Caching
Once we start using quota per user, we may have to start caching the current total bytes used by a user for performance reasons. Otherwise we'll have to count the total number of bytes consumed in all courses for one particular user. That's very intensive...
Status
The first improvement, ability to set a different quota per course instead of the same for all courses, is ready. The rest is not being worked on (Roan did the first improvement for the Vrije Universiteit Brussel, they do not currently ask for a more complex system). The code has been committed into the CVS as well.
Todo: the document tool could display the quota and the # of MB consumed. Also, the message when you upload a file and fail, should be less ambiguous.
- author: Roan Embrechts (first improvement: quota per individual course)
- forum discussion in this thread

