When an assignment activity is set to allow multiple attempt to receive passing grade (we allow 2 attempts), completion tracking (requiring a grade for an activity to be complete) at the course level marks the course as complete (presuming all other requirements are met) even if the student has not got a passing grade and the assignment has been reopened for another attempt/s.
Student submits all work needed for course completion, all work graded with passing grade - course completion is triggered as complete - this is expected and CORRECT.
Student submits all work needed for course completion, all work graded but assignment is reopened for second attempt to receive passing grade, as not yet passed - course completion is triggered as complete (as a grade is recorded against each activity). INCORRECT. This should not happen as the student has another attempt/s remaining at an assessment, so the course is not yet complete for that student.
Student submits all work needed for course completion and has no more attempts left at any necessary activity for completion, all work graded but one or more doesnt have a passing grade - course completion is triggered as complete - this is expected and CORRECT. The student has no more attempts so the course is complete (albeit failed).
This needs rectification ASAP as it will affect anything else that looks for course completion (such as badges - student could receive badge when they havent passed/completed a course yet), student confusion, teacher confusion, custom reports for lists of completions etc