Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9137 META: Rewrite the entire Gradebook system in Moodle 1.9
  3. MDL-9506

Write core API functions lib/gradelib.php and unit tests

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.9
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      http://docs.moodle.org/en/Development:Grades#Core_API_functions

      grade_get_items()
      eg grade_get_items($courseid, $itemname=NULL, $itemtype=NULL, $itemmodule=NULL, $iteminstance=NULL, $itemnumber=NULL, $idnumber=NULL)
      For extracting all the information about what grading items are attached to something. For example, an assignment may want to retrieve all the grade_items for itself, and get three outcome scales in return. This will affect the grading interface.

      grade_create_item()
      To create a new grade_item in case it doesn't exist. This function would be called when a module is created or updated, for example, to ensure grade_item entries exist. It's not essential though - if grades are being added later and a matching grade_item doesn't exist yet, the gradebook will create them on the fly.

      grade_create_category()
      eg grade_create_category(fullname, array of items, aggregation, etc ...) For a given set of items, create a category to group them together (if one doesn't exist yet). Modules may want to do this when they are created. However, the ultimate control is in the gradebook interface itself.

      grade_is_locked($itemtype, $itemmodule, $itemteminstance, $userid=NULL)
      This function will tell a module whether a grade (or grade_item if $userid is not given) is currently locked or not. This is a combination of the actual settings in the grade tables and a check on moodle/course:editgradeswhenlocked. If it's locked to the current use then the module can print a nice message or prevent editing in the module.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08