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

User report on 1.9 gradebook should should display something much better to teachers -- with PATCH

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9, 2.0
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      I know that someone will call the existing behavior a "feature" of the user report, but when a teacher goes to this report, they get their their own personal grades (even when they are not a graded user). This is useless. They should get the grade reports of all their students instead, which would be extremely helpful. It is true that someone could write a new report, but since this is the default report shipping with 1.9, it should have the desirable behavior, IMO.

      To fix, change in \grade\report\user\index.php
      --------------------------------------
      // Create a report instance
      $report = new grade_report_user($courseid, $gpr, $context, $userid);

      // print the page
      print_heading(get_string('modulename', 'gradereport_user'). ' - '.fullname($report->user));

      if ($report->fill_table())

      { echo $report->print_table(true); }
      -------------------------------------------
      to
      ----------------------------------------
      if (has_capability('moodle/grade:viewall', $context)) { //Teachers will see all student reports
      $gui = new graded_users_iterator($course);
      $gui->init();
      if(!isset($gui->grade_items)) $gui->grade_items = array();
      while ($userdata = $gui->next_user()) {
      $user = $userdata->user;
      $report = new grade_report_user($courseid, $gpr, $context, $user->id);
      print_heading(get_string('modulename', 'gradereport_user'). ' - '.fullname($report->user));
      if ($report->fill_table()) { echo $report->print_table(true); }
      echo "<p style = 'page-break-after: always;'></p>";
      }
      $gui->close();
      }else //Students will see just their own report
      {
      // Create a report instance
      $report = new grade_report_user($courseid, $gpr, $context, $userid);

      // print the page
      print_heading(get_string('modulename', 'gradereport_user'). ' - '.fullname($report->user));

      if ($report->fill_table()) { echo $report->print_table(true); }

      }
      -------------------------------------------
      With thanks to our school's (Seattle Academy) Server Administrator Karlene Clapp for the start of this patch

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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