Uploaded image for project: '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
    • Status: Closed
    • Priority: 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

      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.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            andyjdavis 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
            andyjdavis 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
            dougiamas Martin Dougiamas added a comment -

            Adding to sprint because it blocks the related MDL

            Show
            dougiamas Martin Dougiamas added a comment - Adding to sprint because it blocks the related MDL
            Hide
            andyjdavis 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
            andyjdavis 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
            andyjdavis Andrew Davis added a comment -

            PULL-450

            Show
            andyjdavis Andrew Davis added a comment - PULL-450
            Hide
            skodak Petr Skoda added a comment -

            reopening, the comment does not match the code

            Show
            skodak Petr Skoda added a comment - reopening, the comment does not match the code
            Hide
            andyjdavis 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
            andyjdavis 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
            skodak Petr Skoda added a comment -

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

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

            true

            Show
            andyjdavis Andrew Davis added a comment - true
            Hide
            andyjdavis 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
            andyjdavis 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
            andyjdavis Andrew Davis added a comment -

            PULL-454

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

            Thanks Andrew

            Show
            tsala Helen Foster added a comment - Thanks Andrew

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/May/11