General developer forum

Why have you used completion_criteria_completion to mark_complete a course ?

 
Picture of Kahraman Bulut
Why have you used completion_criteria_completion to mark_complete a course ?
Testers

Hi Dev team,

In moodle, I want to understand why have you used  completion_criteria_completion to  mark_complete a course ? (lines 196-197 at /completion/criteria/completion_criteria_course.php)

$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record->timecompleted); 


Why don't you use completion_completion to mark_complete the course ? 

Thanks!

KB. 

 
Average of ratings: -
Davo
Re: Why have you used completion_criteria_completion to mark_complete a course ?
Core developersParticularly helpful MoodlersPlugin developers

completion_criteria_completion handles the use case whereby the completion of course A is dependent on course B being completed.

So, the function in question looks for any 'must complete course B' criteria, whereby a user has completed 'course B', but the criteria is not yet marked as complete, then marks the criteria in course A as complete (but doesn't mark the course A as complete, because there may be other criteria in course A that need to be completed first).


 
Average of ratings: Useful (2)
Picture of Kahraman Bulut
Re: Why have you used completion_criteria_completion to mark_complete a course ?
Testers

Thanks Davo, your explanation helps!

 
Average of ratings: -