Moodle
  1. Moodle
  2. MDL-26768

Lesson is returning 0 when it should return null when it is polled for student grades

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Lesson
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16698

      Description

      As part of MDL-25718 when a students grades are recovered after a student re-enrols in a course grade_grab_course_grades() is called. This goes through all the activity modules and tells each one to update the grades in gradebook. If you create a lesson activity then go through this process a grade of 0.00 appears in gradebook. It should be null to avoid affecting grade averages.

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment -

          Note that Ive called this one a blocker only because it may hold up MDL-25718 which really needs to be released.

          Show
          Andrew Davis added a comment - Note that Ive called this one a blocker only because it may hold up MDL-25718 which really needs to be released.
          Hide
          Martin Dougiamas added a comment -

          Adding to sprint because it blocks the related MDL

          Show
          Martin Dougiamas added a comment - Adding to sprint because it blocks the related MDL
          Hide
          Andrew Davis added a comment - - edited

          repo: git://github.com/andyjdavis/moodle.git
          branch: MDL-26768_0_grade
          diff: https://github.com/andyjdavis/moodle/compare/master...MDL-26768_0_grade

          Note that this bug only occurred when you were updating the grades of a single user and they had a raw grade of null.

          To test:
          1) make sure MDL-25718 has been integrated.
          2) create a new lesson activity. dont access it as a student to ensure no students have a grade for it.
          3) unenroll a student from the course. course administration -> users -> enrolled users. make sure you remove the users enrollment and all grades. dont just suspend their enrollment.
          4) reenrol them on that same page making sure to recover their grades.
          5) go to the grader report in the gradebook and check that the student still has a null grade (a dash) for that lesson.

          Show
          Andrew Davis added a comment - - edited repo: git://github.com/andyjdavis/moodle.git branch: MDL-26768 _0_grade diff: https://github.com/andyjdavis/moodle/compare/master...MDL-26768_0_grade Note that this bug only occurred when you were updating the grades of a single user and they had a raw grade of null. To test: 1) make sure MDL-25718 has been integrated. 2) create a new lesson activity. dont access it as a student to ensure no students have a grade for it. 3) unenroll a student from the course. course administration -> users -> enrolled users. make sure you remove the users enrollment and all grades. dont just suspend their enrollment. 4) reenrol them on that same page making sure to recover their grades. 5) go to the grader report in the gradebook and check that the student still has a null grade (a dash) for that lesson.
          Hide
          Andrew Davis added a comment -

          PULL-450

          Show
          Andrew Davis added a comment - PULL-450
          Hide
          Petr Škoda added a comment -

          reopening, the comment does not match the code

          Show
          Petr Škoda added a comment - reopening, the comment does not match the code
          Hide
          Andrew Davis added a comment -

          Well spotted. Oddly, I actually had the flaw you spotted occur to me last night in a dream. I think I need a holiday.

          Ive fixed it and opened PULL-452

          Show
          Andrew Davis added a comment - Well spotted. Oddly, I actually had the flaw you spotted occur to me last night in a dream. I think I need a holiday. Ive fixed it and opened PULL-452
          Hide
          Petr Škoda added a comment -

          Reopening because (null == 0) evaluates as true again.

          Show
          Petr Škoda added a comment - Reopening because (null == 0) evaluates as true again.
          Hide
          Andrew Davis added a comment -

          true

          Show
          Andrew Davis added a comment - true
          Hide
          Andrew Davis added a comment -

          after discussion with Petr reopening. will add an else to if to be really sure this causes no problems. unfortunately im out of time for today so will have to wait until tomorrow.

          Show
          Andrew Davis added a comment - after discussion with Petr reopening. will add an else to if to be really sure this causes no problems. unfortunately im out of time for today so will have to wait until tomorrow.
          Hide
          Andrew Davis added a comment -

          PULL-454

          Show
          Andrew Davis added a comment - PULL-454
          Hide
          Helen Foster added a comment -

          Thanks Andrew

          Show
          Helen Foster added a comment - Thanks Andrew

            People

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

              Dates

              • Created:
                Updated:
                Resolved: