Moodle
  1. Moodle
  2. MDL-30020

Course completion progress details do not show complete even though course status does

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2.3, 2.3.1
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Course completion
    • Environment:
      OS: Windows Server 2008 R2 Standard SP1
      Web server: IIS7.5
      PHP: 5.3.6 VC9 x86 non-thread-safe
      Driver: Microsoft driver for PHP for SQL Server 2.0.1
      Database server: Microsoft SQL Server Express 2008 R2 (locally hosted)
    • Database:
      Microsoft SQL
    • Testing Instructions:
      Hide

      1. Turn on sitewide course completion tracking via Advanced Features
      2. Create a new course with completion enabled, add the Completion Status block.
      3. Go to the Completion settings page in Course Admin
      4. Enable the course grade criteria (requiring 100%) and save.
      5. Enrol a user in the course, log in as that user and view the "More Details" page linked to via the Completion Status block.
      6. Details page should say the Grade criteria is not complete.
      7. Log back in as admin and manually give the enrolled user a course grade of 100%.
      8. Wait for cron.php to run or manually run it.

      Old behaviour:
      Details page did not show that Grade criteria complete (even though the user had 100% grade).

      Correct behaviour:
      Details page should now say the Grade criteria is complete.

      Show
      1. Turn on sitewide course completion tracking via Advanced Features 2. Create a new course with completion enabled, add the Completion Status block. 3. Go to the Completion settings page in Course Admin 4. Enable the course grade criteria (requiring 100%) and save. 5. Enrol a user in the course, log in as that user and view the "More Details" page linked to via the Completion Status block. 6. Details page should say the Grade criteria is not complete. 7. Log back in as admin and manually give the enrolled user a course grade of 100%. 8. Wait for cron.php to run or manually run it. Old behaviour: Details page did not show that Grade criteria complete (even though the user had 100% grade). Correct behaviour: Details page should now say the Grade criteria is complete.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      19563

      Description

      Even though users meet the course grade requirement, the Complete status on the Completion progress details screen does not change from "No" even though the Course Completion report shows that the user has met the grade requirement and the course is completed.

      I have cron.php set to run every 10 minutes and have also ran it manually numerous times. Using Moodle 2.1.2.

      This appears to be very similar to bug MDL-22685 ("Any criteria of complete course or activity can't reach Completed status"), but that bug is marked closed.

        Issue Links

          Activity

          Hide
          Sam Marshall added a comment -

          This looks to be related to course completion, not activity completion; reassigning.

          Show
          Sam Marshall added a comment - This looks to be related to course completion, not activity completion; reassigning.
          Hide
          Michael de Raadt added a comment -

          A potential fix is suggested in the linked duplicate...

          On 'details.php' page line 247 approx

          echo ($row['status'] === get_string('yes')) ? get_string('yes') : get_string('no');
          

          It always compare to 'yes' but in case of 'graded activities' it is not 'yes' even you have completed (rather it contains the pass criteria/percentage.

          I added approx line 191

          $row['completion_flag'] = $complete;
          

          before

          $rows[] = $row;
          

          changed line

          echo ($row['status'] === get_string('yes')) ? get_string('yes') : get_string('no');
          

          to

          echo ($row['completion_flag'] == 1 ) ? get_string('yes') : get_string('no');
          

          After these changes everything is working fine for me.

          Show
          Michael de Raadt added a comment - A potential fix is suggested in the linked duplicate... On 'details.php' page line 247 approx echo ($row['status'] === get_string('yes')) ? get_string('yes') : get_string('no'); It always compare to 'yes' but in case of 'graded activities' it is not 'yes' even you have completed (rather it contains the pass criteria/percentage. I added approx line 191 $row['completion_flag'] = $complete; before $rows[] = $row; changed line echo ($row['status'] === get_string('yes')) ? get_string('yes') : get_string('no'); to echo ($row['completion_flag'] == 1 ) ? get_string('yes') : get_string('no'); After these changes everything is working fine for me.
          Hide
          Adrian Greeve added a comment -

          Hi Aaron,

          The code for this looks fine. One minor suggestion is to possibly explain in a little more detail how to configure course completion in the testing instructions.

          Show
          Adrian Greeve added a comment - Hi Aaron, The code for this looks fine. One minor suggestion is to possibly explain in a little more detail how to configure course completion in the testing instructions.
          Hide
          Aaron Barnes added a comment -

          Big update and improvements to code.

          Show
          Aaron Barnes added a comment - Big update and improvements to code.
          Hide
          Adrian Greeve added a comment -

          Hello Aaron,

          I had another look at the code. The functionality is good.

          Just a couple of minor things.

          • blocks/completionstatus/details.php
            • line 180: I'm not sure what this line is doing. It doesn't seem to be used.
              global $COMPLETION_CRITERIA_TYPES;
              
            • line 269: This line is quite long. I know that the integrators would like lengths to be less than 140 characters long.

          Apart from that everything else is good.

          Thanks.

          Show
          Adrian Greeve added a comment - Hello Aaron, I had another look at the code. The functionality is good. Just a couple of minor things. blocks/completionstatus/details.php line 180: I'm not sure what this line is doing. It doesn't seem to be used. global $COMPLETION_CRITERIA_TYPES; line 269: This line is quite long. I know that the integrators would like lengths to be less than 140 characters long. Apart from that everything else is good. Thanks.
          Hide
          Aaron Barnes added a comment -

          Thanks Adrian, all fixed!

          Show
          Aaron Barnes added a comment - Thanks Adrian, all fixed!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Sam Hemelryk added a comment -

          Thanks Aaron, all looked good and has been integrated now.
          Thanks for cleaning things up btw.

          Show
          Sam Hemelryk added a comment - Thanks Aaron, all looked good and has been integrated now. Thanks for cleaning things up btw.
          Hide
          Ankit Agarwal added a comment -

          Works as expected.
          Thanks

          Show
          Ankit Agarwal added a comment - Works as expected. Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Many thanks for the hard work.

          These changes have been spread upstream and are already available in the git and cvs repositories.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Many thanks for the hard work. These changes have been spread upstream and are already available in the git and cvs repositories. Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: