Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Grades

From MoodleDocs
Revision as of 14:09, 3 August 2006 by Martin Dougiamas (talk | contribs) (Initial draft of some ideas for the new Gradebook)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page is to create a specification for the next generation of Moodle gradebook. If you edit it, please try and keep modifications under the correct headings.

Centralising data

Currently (in all versions up to 1.6) Moodle uses a "pull" model for grade collection. That is, at the time a user requests a view of the gradebook, each activity module is polled for grades and either returns grades or it doesn't. These are then massaged into the gradebook view.

Problems with this are bad performance and less flexibility.

In the next version, the modules must "push" their grades to the central gradebook at the time grades are changed. For example, if a student completes a quiz, the quiz module should call a central function such as grade_store() with courseid, userid, moduleid, column name, grade type and grade. This data gets stored in a central table (like grades).

Modules can store grades internally as well if they want to (for efficiency and reports etc). All storing of grades centrally should take place via the API function: modules must not manipulate the grades table directly.

An option in the gradebook should allow grades to be retained even if the activity that generated it has been deleted. If this is turned off, then when displaying the columns, a clean-up function should check the course format, and remove columns belonging to obsolete activities.

For backward compatibility, a Moodle cron trigger should cause the gradebook to periodically look in activity modules for an old-style xxxx_grades() function, then call that function to extract and cache grades locally.


Additional columns

With a centralised table, it should be easier to add support for manual or ad-hoc calculation columns that are not connected to any activity table.

For example, a final course grade column could be created that is a mathematical calculation based on other columns. Syntax could be provided to make the column empty unless all the other columns contain a value of some kind (for that user).


Export API

A great need is to connect grades to external systems, such as Student Information Systems.

A plugin system should be added that can export grades to external systems, either at the time grades are added or via cron. The plugins take care of which data is chosen and where it goes.

Other ideas