Moodle
  1. Moodle
  2. MDL-38149

AJAX Grading causes error with activities with no grades

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide

      Make sure you have ajax on.

      Create a brand new course and enrol at least one student. Don't create any activities.

      Go to the grader report and make sure you have grader report ajax on. Grader report settings are in the gradebook navigation drop down.

      Check that there are not JS errors in the error console with editing on and off.

      Add an activity and then go to the gradebook and give the student a grade.

      Go to a course with activities and existing grades and override a student grade. Check that you dont get any JS errors and that the override takes effect.

      Show
      Make sure you have ajax on. Create a brand new course and enrol at least one student. Don't create any activities. Go to the grader report and make sure you have grader report ajax on. Grader report settings are in the gradebook navigation drop down. Check that there are not JS errors in the error console with editing on and off. Add an activity and then go to the gradebook and give the student a grade. Go to a course with activities and existing grades and override a student grade. Check that you dont get any JS errors and that the override takes effect.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull 2.4 Branch:
      MDL-38149_ajax_24
    • Pull Master Branch:
      MDL-38149_ajax
    • Rank:
      47975

      Description

      Just filling this in From michaels comments in MDL-34800, since we are addressing this in a new issue:
      "I found one factor that you might be able to replicate for your testing. I am using a gradebook that has activities in it, but no actual grades. In other words, it is a fresh course restore. When I add some marks and click Update, the page refreshes and then things seem to work as expected. This might explain the difference I was seeing between versions before. After adding some grades in the stable version, the update button disappears as reported; in the integration version, the button is now disabled.
      I retested this with FF, Chrome and IE and they all reported a JS error. IE isolated it down to the following...
      SCRIPT5007: Unable to get property 'length' of undefined or null reference
      module.js, line 1 character 12608
      ...which seems to revolve around this statement...
      for(var i=0;i<this.report.grades.length;i++)if(this.report.grades[i]...
      ...which leads back to the report FF gave (shown above).
      I hope this helps."

        Issue Links

          Activity

          Hide
          Damyon Wiese added a comment -

          PR Checklist:

          [Y] Syntax
          [-] Output
          [N] Whitespace - I realise you didn't introduce it - but "for(" with no space looks horrible, since you are changing this line anyway can you fix it please?
          [-] Language
          [-] Databases
          [Y] Testing - Note - I changed Activity to Course in your test instructions - I think that is what you meant.
          [-] Security
          [-] Documentation
          [Y] Git
          [Y] Sanity check (Tested the bug and the fix)

          Thanks Andrew,

          This is fine for integration with that whitespace fix.

          Show
          Damyon Wiese added a comment - PR Checklist: [Y] Syntax [-] Output [N] Whitespace - I realise you didn't introduce it - but "for(" with no space looks horrible, since you are changing this line anyway can you fix it please? [-] Language [-] Databases [Y] Testing - Note - I changed Activity to Course in your test instructions - I think that is what you meant. [-] Security [-] Documentation [Y] Git [Y] Sanity check (Tested the bug and the fix) Thanks Andrew, This is fine for integration with that whitespace fix.
          Hide
          Andrew Davis added a comment -

          Thanks Damyon. I've fixed up that white space and created 2.4 and 2.3 versions. Putting this up for integration.

          Show
          Andrew Davis added a comment - Thanks Damyon. I've fixed up that white space and created 2.4 and 2.3 versions. Putting this up for integration.
          Hide
          Sam Hemelryk added a comment -

          Thanks Andrew, this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Andrew, this has been integrated now.
          Hide
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for 2.3, 2.4 and master

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working as expected. Tested for 2.3, 2.4 and master Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities.

          Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied).

          Thanks, closing as fixed!

          Show
          Eloy Lafuente (stronk7) added a comment - This is valid for unlimited entries to the, soon to be unveiled, Moodle Codebase Gardens. It includes free access to all facilities. Personal and non-transferable to all assignees, reviewers and testers in this issue. Valid until switching to Blackboard (100000€ penalization will be applied). Thanks, closing as fixed!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: