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

Completion: Incorrectly marks complete when grade data present with no actual grade

    Details

    • Testing Instructions:
      Hide

      0. turn on completion systemwide and for course.
      1. add new assignment, set to online text, complete automatically when user achieves grade.
      2. edit gradebook, grade settings, select the settings for the assignment grade, select pass grade 50
      3. if necessary, enrol a test student account in the course.

      4. log in to course as the test student.

      EXPECTED: Completion tickbox shows dotted outline with nothing in (=not completed).

      5. go into the assignment, type something, submit it, and return to course page.

      EXPECTED: The completion tickbox next to the assignment should still show the dotted outline and no X or tick

      6. log out as the student. log in as admin. Grade the submitted assignment as 40 (fail)

      7. log out as admin. log in as the student. Look at course page.

      EXPECTED: The completion tickbox next to the assignment should now show an X inside the dotted outline.

      Show
      0. turn on completion systemwide and for course. 1. add new assignment, set to online text, complete automatically when user achieves grade. 2. edit gradebook, grade settings, select the settings for the assignment grade, select pass grade 50 3. if necessary, enrol a test student account in the course. 4. log in to course as the test student. EXPECTED: Completion tickbox shows dotted outline with nothing in (=not completed). 5. go into the assignment, type something, submit it, and return to course page. EXPECTED: The completion tickbox next to the assignment should still show the dotted outline and no X or tick 6. log out as the student. log in as admin. Grade the submitted assignment as 40 (fail) 7. log out as admin. log in as the student. Look at course page. EXPECTED: The completion tickbox next to the assignment should now show an X inside the dotted outline.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-41446-master

      Description

      Add an assignment to a course with these global and particular settings:

      1. In Site administration > Advanced features:
      Enable completion tracking and conditional access.

      2. Course: Enable completion tracking.

      3.a. Add an assignment and set:
      Activity completion.
      Completion tracking:
      Require grade: Student must receive a grade to complete this activity.

      So, completion tracking must work like this:
      When the assignment is sent but not graded, the check box must remain empty until the assignment has a grade. Then, when is finally graded, it shows a blue tick no matter what grade it was.

      3.b. Add an extra condition to the assignment and set a 'Grade to pass'.

      So, completion tracking must work like this now:
      When the assignment is sent but not graded, the check box must remain empty until the assignment has a grade. Then, when is finally graded, it must show a green tick if it pass or a red cross if it fail, but actually it works this other way:
      When the assignment is sent, immediately it shows a red cross instead of remaining empty until it was graded.

      I actually left a previous message in assignment forum (https://moodle.org/mod/forum/discuss.php?d=235244#p1021700) but I guess this is the right place instead.
      Thanks!

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            monicase Mónica Sánchez added a comment -

            Thanks for the related issue but, in this case it has nothing to do with logout/login subject
            It has nothing to do with themes either. I'm using Arctic theme (by Mary Evans), very customized nowadays, but I tested this issue with other standard themes like Formal White and I got the same.
            Am I missing something?
            Thank's in advance!
            me, again.

            Show
            monicase Mónica Sánchez added a comment - Thanks for the related issue but, in this case it has nothing to do with logout/login subject It has nothing to do with themes either. I'm using Arctic theme (by Mary Evans), very customized nowadays, but I tested this issue with other standard themes like Formal White and I got the same. Am I missing something? Thank's in advance! me, again.
            Hide
            quen Sam Marshall added a comment -

            Confirmed: I can reproduce this using the test script described (although I shortened it a bit).

            0. turn on completion systemwide and for course.
            1. add new assignment, set to online text, complete automatically when user achieves grade.
            2. edit gradebook, grade settings, select the settings for the assignment grade, select pass grade 50
            3. enrol in the course if required, then submit the assignment
            4. go back to course page (turn editing off if required)

            EXPECTED: The completion tickbox next to the assignment should show the dotted outline and no X or tick

            ACTUAL: It currently shows a red X

            Now looking at why.

            Show
            quen Sam Marshall added a comment - Confirmed: I can reproduce this using the test script described (although I shortened it a bit). 0. turn on completion systemwide and for course. 1. add new assignment, set to online text, complete automatically when user achieves grade. 2. edit gradebook, grade settings, select the settings for the assignment grade, select pass grade 50 3. enrol in the course if required, then submit the assignment 4. go back to course page (turn editing off if required) EXPECTED: The completion tickbox next to the assignment should show the dotted outline and no X or tick ACTUAL: It currently shows a red X Now looking at why.
            Hide
            quen Sam Marshall added a comment -

            You can see in the gradebook that a grade is NOT set for this activity for the user (it shows '-' rather than 0 or anything).

            Show
            quen Sam Marshall added a comment - You can see in the gradebook that a grade is NOT set for this activity for the user (it shows '-' rather than 0 or anything).
            Hide
            quen Sam Marshall added a comment -

            OK, I've tracked this down. Basically for some reason the assignment module creates the grade data for that user, even though they don't have a grade yet, when they submit. So the grade data is present, but with no grade in it.

            The completion system does not work in that situation. It expects that if the grade data is present, it will contain a grade value.

            I've done a code patch which I will submit for peer review.

            Show
            quen Sam Marshall added a comment - OK, I've tracked this down. Basically for some reason the assignment module creates the grade data for that user, even though they don't have a grade yet, when they submit. So the grade data is present, but with no grade in it. The completion system does not work in that situation. It expects that if the grade data is present, it will contain a grade value. I've done a code patch which I will submit for peer review.
            Hide
            monicase Mónica Sánchez added a comment -

            Thanks to make it shorter, Sam, so easier to reproduce
            And yes, there's no a grade in the gradebook; actually the checkbox shows the red X when the assignment is just submitted.
            For a while I thought it has to do with remain the checkbox status as not-accomplished when the student submit the assignment... but I'm just thinking out loud.
            Thanks for the review.

            Show
            monicase Mónica Sánchez added a comment - Thanks to make it shorter, Sam, so easier to reproduce And yes, there's no a grade in the gradebook; actually the checkbox shows the red X when the assignment is just submitted. For a while I thought it has to do with remain the checkbox status as not-accomplished when the student submit the assignment... but I'm just thinking out loud. Thanks for the review.
            Hide
            damyon Damyon Wiese added a comment -

            Thanks for tracking this down Sam (And for the bug report Monica)

            [Y] Syntax
            [Y] Whitespace
            [-] Output
            [-] Language
            [-] Databases
            [Y] Testing (instructions and automated tests)
            [-] Security
            [-] Documentation
            [Y] Git
            [Y] Sanity check

            Looks correct and in order to me.

            Pushing for integration.

            Show
            damyon Damyon Wiese added a comment - Thanks for tracking this down Sam (And for the bug report Monica) [Y] Syntax [Y] Whitespace [-] Output [-] Language [-] Databases [Y] Testing (instructions and automated tests) [-] Security [-] Documentation [Y] Git [Y] Sanity check Looks correct and in order to me. Pushing for integration.
            Hide
            monicase Mónica Sánchez added a comment -

            Thanks you both!

            Show
            monicase Mónica Sánchez added a comment - Thanks you both!
            Hide
            damyon Damyon Wiese added a comment -

            Sorry - looks like I pushed the wrong button on this a while ago. I checked and the master branch is fine for both 26 and master. Sending to integration.

            Show
            damyon Damyon Wiese added a comment - Sorry - looks like I pushed the wrong button on this a while ago. I checked and the master branch is fine for both 26 and master. Sending to integration.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated (24, 25, 26 and master), thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (24, 25, 26 and master), thanks!
            Hide
            rwijaya Rossiani Wijaya added a comment -

            This is working as expected.

            Tested for 2.4, 2.5, 2.6 and master.

            Test passed.

            Show
            rwijaya Rossiani Wijaya added a comment - This is working as expected. Tested for 2.4, 2.5, 2.6 and master. Test passed.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks for your contributions, this change is now upstream!

            “ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” - Edsger Dijkstra

            Show
            poltawski Dan Poltawski added a comment - Thanks for your contributions, this change is now upstream! “ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ” - Edsger Dijkstra

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Jan/14