Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12822

Improve current gradebook API ASAP

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      remove these functions from gradelib.php ASAP:

      • grade_exists() - activities may have several grades, instead we need status: submitted/graded/returned, etc. (needs db changes, 2.0)
      • grade_get_grade_items_for_activity() - activities MUST use $courseid, $itemtype, $itemmodule, $iteminstance, $itemnumber, or it could use $cm and $itemnumber; anyway this returns too much information which would definitely break in 2.0
      • grade_get_grade_activities() - nothing like this should be allowed outside of gradebook!
      • grade_get_grade_items() - again this breaks the separation rule, gradebook is not a list of items
      • grade_get_user_grade() - raw float is useless, grade is much, much more than float value - it does not even check if item needs update
      • grade_get_course_grade() - we must define course grade and completion properly first before we expose it

      The problem is that modules should access only own grades and these function return too much/invalid information.

      API for all gradebook plugins must be stored in grade/lib.php - we already have there several useful classes and methods
      API for gradebook reports must be in grade/report/lib.php - we have the abstract report class there.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            skodak Petr Skoda
            Tester:
            Nicolas Connault Nicolas Connault
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

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