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

assign/locallib attempts to get decimals of assignments of grade type none

XMLWordPrintable

    • MOODLE_30_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-56948-master
    • Hide
      1. Create a mod_assign instance with the grade type set to 'None'.
      2. Remove the record from the grade_items table that corresponds to the assignment activity that you just created (there should be no records for the assignment activity in that table).
      3. As a teacher, go to the assignment and click 'View all submissions'.
      4. Verify that the grading table is displayed as expected, with no coding exception thrown.
      Show
      Create a mod_assign instance with the grade type set to 'None'. Remove the record from the grade_items table that corresponds to the assignment activity that you just created (there should be no records for the assignment activity in that table). As a teacher, go to the assignment and click 'View all submissions'. Verify that the grading table is displayed as expected, with no coding exception thrown.

      When viewing the submissions of any assignment that has the Grade Type of None a coding exception is thrown because /mod/assign/locallib.php attempts to get the decimals of grade when there is no grade. Changing the assignment to Grade Type Point enables you to view the submissions page.

      1. View an assignment of grade type None that has submissions.
      2. Click on "View/grade all submissions"

      Debug info:
      Error code: codingerror
      Stack trace:
      line 1220 of /mod/assign/locallib.php: coding_exception thrown
      line 1332 of /mod/assign/locallib.php: call to assign->get_grade_item()
      line 639 of /mod/assign/gradingtable.php: call to assign->display_grade()
      line 861 of /mod/assign/gradingtable.php: call to assign_grading_table->display_grade()
      line 817 of /lib/tablelib.php: call to assign_grading_table->col_grade()
      line 463 of /mod/assign/gradingtable.php: call to flexible_table->format_row()
      line 1521 of /lib/tablelib.php: call to assign_grading_table->format_row()
      line 1638 of /lib/tablelib.php: call to table_sql->build_table()
      line 1233 of /mod/assign/renderer.php: call to table_sql->out()
      line 1029 of /mod/assign/renderer.php: call to mod_assign_renderer->flexible_table()
      line 319 of /lib/outputrenderers.php: call to mod_assign_renderer->render_assign_grading_table()
      line 3412 of /mod/assign/locallib.php: call to plugin_renderer_base->render()
      line 3450 of /mod/assign/locallib.php: call to assign->view_grading_table()
      line 552 of /mod/assign/locallib.php: call to assign->view_grading_page()
      line 52 of /mod/assign/view.php: call to assign->view()

      Version 3.0.7 vs 3.0.6 introduced the following code on line 1332 of /mod/assign/locallib.php

      $decimals = $this->get_grade_item()->get_decimals();

            tonybutler Tony Butler
            mwfischer10 Mark Fischer
            Ryan Wyllie Ryan Wyllie
            Dan Poltawski Dan Poltawski
            Jake Dallimore Jake Dallimore
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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