Course completion not triggered

Course completion not triggered

by Frances Angulo -
Number of replies: 11



Course completion is set to "ALL activities to be completed" and as you can see, they're all completed for these students. What else can I check? I enabled the course completion block and it shows that these activities are not complete- but it is indicated that they are!



Average of ratings: -
In reply to Frances Angulo

Re: Course completion not triggered

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry Frances that you've had no reply to your question.  At a guess I wonder if the cron job triggers the checking and it has not been run?

In reply to Gareth J Barnard

Re: Course completion not triggered

by Frances Angulo -

Thanks for the thought, I manually ran cron job and it did not satisfy the problem,

In reply to Frances Angulo

Re: Course completion not triggered

by Peter Bowen -

It certainly looks like a CRON issue. You  need to run the CRON 3 times between activity completion and course completion.


What version of moodle / host etc?


Do you have access to the back end database? You may be able to see what is happening there by investigating the course_modules_completion table as well as the course_completions table.


Cheers
Peter

In reply to Frances Angulo

Re: Course completion not triggered

by Ravi Murugesan -
Picture of Particularly helpful Moodlers Picture of Testers

Just to say that I faced the same problem yesterday on my Moodle site (v 2.6). I'm a front-end Moodle admin and don't have access to the Moodle server, so I can't do any cron stuff apart from the browser-triggered cron (<moodle site>/admin/cron.php). That didn't help. I just waited overnight and this morning I could see the course complete box ticked smile I suppose the cron job had run the required number of times.

In reply to Ravi Murugesan

Re: Course completion not triggered

by Elisa Cesarei -


Hello everybody,


I am facing the same problem: just an activity completed but course not marked as completed. I tried to modify the file cron.php as suggested by Peter Dekker and then I made the Cron job run executing a bat file containing this line


@echo off C:\Bitnami\moodle-3.1.2-0\php.exe -f C:\Bitnami\moodle-3.1.2-0\apps\moodle\htdocs\completion\cron.php >> C:\Bitnami\moodle-3.1.2-0\moodle-cron.log


Several times, but nothing changed.


I also tried do modify the last lines on cron.php in this way: from this


 


function completion_cron_aggregate($method, $data, &$state) {


    if ($method == COMPLETION_AGGREGATION_ALL) {


        if ($data && $state !== false) {


            $state = true;


        } else {


            $state = false;


        }


    } elseif ($method == COMPLETION_AGGREGATION_ANY) {


        if ($data) {


            $state = true;


        } else if (!$data && $state === null) {


            $state = false;


        }


    }


}


 


To the following


 


function completion_cron_aggregate($method, $data, &$state) {


    if ($method == COMPLETION_AGGREGATION_ALL) {


        if ($data && $state !== false) {


            $state = true;


        } else {


            $state = true;


        }


    } elseif ($method == COMPLETION_AGGREGATION_ANY) {


        if ($data) {


            $state = true;


        } else if (!$data && $state === null) {


            $state = true;


        }


    }


}


 


But still nothing happens.


In reply to Elisa Cesarei

Re: Course completion not triggered

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

There should be no need to modify cron.php.  If you look at your scheduled tasks, you should be able to tell if cron is running correctly.

In reply to Emma Richardson

Re: Course completion not triggered

by Elisa Cesarei -

Hi Emma, thanks for your suggestion. Would you mind to indicate the path to shceduled tasks ?

Thanks a lot. Cheers

In reply to Elisa Cesarei

Re: Course completion not triggered

by Elisa Cesarei -

Hello, I found the path to scheduled tasks, the problem is 1) I am not sure i correct identify the tasks 2) even if I have tasks scheduled to run every minute, last run column says they have never been run (as it comes out for the two scheduled tasks which I suspect to be relevant (see attached screenshot please)

Attachment completion_learning_plans.png
Attachment completion_mark.png
In reply to Elisa Cesarei

Re: Course completion not triggered

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The fact that they have never run means that cron is not setup or not setup correctly.  You need to get cron running...