This is a bug fix / improvement that I think should be done, and I can do it (very easily), but it's a change from how part of Moodle used to work. Therefore I wanted to get some feedback on how to make the adjustment with minimal surprise to any users who may be relying on the old behavior. Maybe we put a setting somewhere. Some users think the new / corrected behavior is what one would expect, so no setting is needed - just make it do what it says it does.
Activities can have four possible completion states:
INCOMPLETE: The student has not completed the activity.
COMPLETE_PASSED The student has not completed the activity. Also, the student achieved a passing grade on the activity.
COMPLETE_FAILED (optional) The student has not completed the activity. Also, the student had a failing grade on the activity.
COMPLETE_COMPLETED The activity has been completed. No passing grade was set.
For most (all?) activities, the user can choose to not allow COMPLETE_FAILED by requiring a passing grade in order to mark it complete (ie quiz) or requiring a specific grade (ie scorm). So complete_failed is generally optional - the user can choose settings to only allow completion if it's passed.
Within "conditional activities", criteria work as the language indicates: requiring an activity to be completed before another is visible means it's not visible if the prerequisite is still INCOMPLETE, it becomes visible when the prerequisite is marked COMPLETE_*, when it's completed, regardless of what the grade was.
In conditional activities, if you want to require that it's completed and passed, you simply either set the prerequisite to not be completed unless it's passed, or set a specific grade to be required.
Course completion, on the other hand, does not work as one might expect. If a course requires that the student complete the pretest, study module, and final, it does not mark the course as complete when those three activities are marked as complete. Instead, the course will only be marked complete if the student both completes the pretest and also achieves a passing grade. This means that in the completion report, the teacher may see that all of the required activities are marked complete, but the course isn't marked complete.
I propose that course completion should work like activity completion does. "Require these activities to be complete" should mean that when those activities are marked as complete, the course is marked complete. This would be a very simple one-line fix. Note again, if a user wants the old behavior of requiring that an activity be passed in order to be considered complete, they still have that option. I'm not suggesting anything be removed. I'm proposing that we not force / override that in the course completion aggregation code, but rather honor the setting that was set on the activities completion settings.
Is anyone relying on the old behavior of course completion, of "completed" really meaning "both completed and also have a passing grade"? Are there any suggestions for how to make this improvement without affecting users who may be relying on the old behavior?