Moodle
  1. Moodle
  2. MDL-25171

Selecting no Grades in gradebook export returns all grades

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.10
    • Fix Version/s: 1.9.11
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      1360

      Description

      When exporting gradebook, and choosing no grade items, the preview shows only the user data fields, but when the actual file is downloaded, all of the grade items are included. Looking at the code, in /grade/export/lib.php in the grade_export function I see a place where if the itemlist provided is empty, it populates the columns property with all available grade items. This seems counter intuitive. I'm attaching a patch that removes this code, and seems to solve the problem for me. I'm wondering if anyone else has experienced this problem or sees any problems with removing this code.

        Activity

        Hide
        Andrew Davis added a comment -

        Hi Nate. Ive committed a fix to the 2.0 branch. I'll look at 1.9 tomorrow. It was a little more complex than your patch as, in 2.0 at least, an empty item list indicates either all grade items or no grade items. I've altered it to use an item list of -1 to explicitly indicate no items.

        Show
        Andrew Davis added a comment - Hi Nate. Ive committed a fix to the 2.0 branch. I'll look at 1.9 tomorrow. It was a little more complex than your patch as, in 2.0 at least, an empty item list indicates either all grade items or no grade items. I've altered it to use an item list of -1 to explicitly indicate no items.
        Hide
        Andrew Davis added a comment -

        I've backported that fix to 1.9. Let me know if you notice anything more

        Show
        Andrew Davis added a comment - I've backported that fix to 1.9. Let me know if you notice anything more
        Hide
        Nate Baxley added a comment -

        Thanks for the quick turnaround Andrew. It seems to be working great.

        Show
        Nate Baxley added a comment - Thanks for the quick turnaround Andrew. It seems to be working great.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: