General developer forum

Difference between completion_completion and completion_criteria_completion classes

 
Picture of Kahraman Bulut
Re: Difference between completion_completion and completion_criteria_completion classes
Testers

Thanks Davo and Matteo, 

That's good. Can you please explain why it is calling the function mark_complete($record->timecompleted); of  the completion_criteria_completion class with the parameter, where completion_criteria_completion class has no parameter in its function 

public function mark_complete()
(line 197 at https://github.com/moodle/moodle/blob/master/completion/criteria/completion_criteria_course.php) :


foreach ($rs as $record) {
$completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record->timecompleted);
}

And the mark_complete function of  class completion_completion DO have a parameter
public function mark_complete($timecomplete = null) {

Can you please help me to bring together the pieces of this puzzle?

Thanks!


Best regards,

KB.



 
Average of ratings: -