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

Scale can be deleted when still in use

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 4.0.6, 4.1.1
    • Gradebook
    • MOODLE_400_STABLE, MOODLE_401_STABLE

      Steps to reproduce issue

      1. Enable debugging (Debug messages: DEVELOPER; Display debug messages: Yes).
      2. From Site administration > Grades > Scales click Add a new scale.
      3. Give it a name ("Scale 1") and a scale ("Low, Medium, High") and click Save changes.
      4. Create course 1.
      5. Enrol student on course 1.
      6. Add an assignment to course 1:
        1. Give it a name.
        2. Under the Grade heading in the Grade field change Type to "Scale" and select "Scale 1".
        3. Click Save changes.
      7. On the course page click the Grades tab:
        1. For the enrolled student grade the assignment using the selected scale ("Medium").
        2. Click Save changes.
      8. Create course 2.
      9. From course 2 select the Grades tab and change the view to Scales using the drop-down list.
      10. By "Scale 1" click the edit icon (gear wheel).
      11. Untick Standard scale and click Save changes.
      12. Delete course 2.
      13. Go to course 1.
      14. In course 1 view grade book

      Expected results

      The grades appear without error.

      Actual results

      Grade average for assignment is "Error". The following error appears (ID may vary):

      Incorrect scale id: 3

      line 1028 of /lib/grade/grade_item.php: call to debugging()
      line 843 of /lib/gradelib.php: call to grade_item->load_scale()
      line 796 of /lib/gradelib.php: call to grade_format_gradevalue_real()
      line 1606 of /grade/report/grader/lib.php: call to grade_format_gradevalue()
      line 1254 of /grade/report/grader/lib.php: call to grade_report_grader->get_right_avg_row()
      line 1270 of /grade/report/grader/lib.php: call to grade_report_grader->get_right_rows()
      line 166 of /grade/report/grader/index.php: call to grade_report_grader->get_grade_table()

            Unassigned Unassigned
            leonstr Leon Stringer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.