course completion not working

course completion not working

by Peter Dekker -
Number of replies: 22

I have a situation similar to one described earlier, meaning that conditional course completion is not checked even though all prerequisites have been met.  Even more, the course completion block indicates that activity tracking is not ON, even though it is and checkboxes and checkmarks are shown.

 I have this issue in both Moodle2.7.1 (Build: 20140714) and Moodle2.7.1+ (Build: 20140821)

Average of ratings: -
In reply to Peter Dekker

Re: course completion not working

by Peter Bowen -

Can you put a screen shot of your completion requirements, and of the completion block?  It may help to understand what you mean.

Cheers
Peter

In reply to Peter Bowen

Re: course completion not working

by Peter Dekker -

Yes Peter, here are the details:

1. Please see below a completion report for this simple 1-activity course with automatic completion tracking for that activity. The course completion block on the right shows a 'no tracking' and the tracking box for the course is not checked.

course completion status

2. However, course completion has only one condition which is the completion of this one activity (all other conditions are unchecked).

course completion settings

3. This one activity is completed once seen, as was confirmed by the checked box in the first picture:

activity completion

I've attached a SQL export of the course database tables.

btw, Cron has run several times meanwhile.

In reply to Peter Dekker

Re: course completion not working

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Are you viewing that course completion block as a teacher or someone instead of the student role?Because then I would expect it to say you are not being tracked because Moodle thinks you only want to track students.
In reply to Mary Cooch

Re: course completion not working

by Peter Dekker -

You're entirely right Mary, it looks different from a student perspective (sorry for the Dutch in the screenshot). However, although the completion box is checked as you can see, the block says Busy and Status completed 0 out of 1.

student view

When you click on view details in the block, the following appears:

Status: not yet started

Completed: no.

This contradicts the fact that the activity has been completed, as illustrated by the checked box in the image above.

completion details


Now, I just had in idea. When looking for solutions, I've seen many video's on Youtube about course completion and its settings. All those were made with earlier versions of Moodle, e.g. 2.0. In those video's, with the activity completion settings, there was an extra checkbox that is absent in 2.7: start tracking with enrollment. Does this suggest that tracking has not started in 2.7?

In reply to Peter Dekker

Re: course completion not working

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

It's OK - I can speak German so I can guess a lot of Dutchwink  I can only think like others that this is a cron issue - hopefully some cron experts can come along and suggest solutions...

In reply to Mary Cooch

Re: course completion not working

by Frances Angulo -

Please see my post  here https://moodle.org/mod/forum/discuss.php?d=267257


I think we are having the same problem?

In reply to Frances Angulo

Re: course completion not working

by Peter Dekker -

Yes Frances, I think we do (I even referred to your post in my first). I' ve just posted a request for a cron expert opinion in this thread.


In reply to Peter Dekker

Re: course completion not working

by Peter Bowen -

A couple of things.

I cannot put my finger on why, but I did find at some stage in the past (somewhere between 2.2 and 2.6) I had to have all for General completion requirements, even if there was only one requirement. (Rather than any)


The other thing I notice, is in the SQL you provided, the course_completions table has times in the 'reaggregate' column, which is the signal to CRON that it needs to recalculate this. (It is the same time that is in the course_completion_crit_compl table). The next time it runs, it 'should' update that table.


Kind regards

Peter



In reply to Peter Bowen

Re: course completion not working

by Peter Dekker -

I've found a solution. Peter previously remarked that the database seems ready for recalculation. So why doesn't cron pick that up? It seems that since in Moodle 2.6 students cannot be actively marked as started on a course, the course completion check for them doesn't start either.

In cron.php in the Moodle/completion folder, in lines 50-55 there is a function checking the Started status of a student. I just deleted the debugging check and marked all students as started. 

Now, after a couple of cron runs as suggested, the course completion check works!

This is what I did:

Old:

if (debugging()) {
        mtrace('Marking users as started');
}

New:

 /*   if (debugging()) { */
        mtrace('Marking users as started');
 /*   } */

In reply to Peter Dekker

Re: course completion not working

by Peter Bowen -

That makes sense.

Question - are the students enrolled in the course, as in do they have a role?

Or is the course open to be able to enter without having a role?

We have a similar issue, where if a third party books someone into a face-to-face session, it enrols them in the course but does not give them a student role, so they therefore cannot complete the course. To get around this, we run a daily SQL query which looks for enrolled without a role, and then uploads them via csv as a student in the course - and all is happy in the world.

Kind regards

Peter


Average of ratings: Useful (1)
In reply to Peter Bowen

Re: course completion not working

by Peter Dekker -

Good suggestion Peter but yes, all participants in the course have a student role; the site is not open for guests.

In reply to Peter Dekker

Re: course completion not working

by Sathya A -

Thanks Peter your solution worked perfectly.

In reply to Sathya A

Re: course completion not working

by Jaswant Tak -
Sorry, re-opening an old thread, as it is related to the same topic.

I just added one cohort sync method and enrolled the students in the course, now later I  removed the cohort sync method from the course, so as per the documentation when we remove the cohort sync method from a course it unenrols all the users of that cohort correct?

In course completion criteria, I have selected the condition 'Unenrolment' i.e. when a user gets unenrolled from a course the completion should mark as done. But it is not working.

My question is, Does the unrolment condition in course completion settings, only works with manual unrolment?

Regards
Jaswant


In reply to Peter Dekker

Re: course completion not working

by venkatavinodh kotha -

hello sir,


   I got solution course completion is checked when all activities in course are completed.To get that:

  In server - > scheduled tasks run the service calculate regular completion data. Then the problem will be

 solved that is course completion check box will be enabled.




Thanks and Regards,

Venkata Vinodh Kotha

  

Attachment coursecompletion.jpg
In reply to Peter Dekker

Re: course completion not working

by Kay Mo -

Hello all

I had a similar issue: all activities completed but the course completion did not update accordingly and was showing 0 activities completed.

It was a brand new install and the problem got fixed as soon as the Moodle's cron job  setup was completed.

We ran it first on the command line and then every ninute using the Cpanel cron job console as explained here:

https://docs.moodle.org/33/en/Cron_with_Unix_or_Linux

... and  that's it: the course completion status is now updated as completed automatically as expected!

Thanks for pointing to the Cron issue.




In reply to Kay Mo

Re: course completion not working

by Joanne Kirby -

Hi I'm very new to moodle and with the help from this forum I've been able to resolve most of issues except one.

I have a similar issue as previously described, I'm running on the MoodleCloud, so I am not sure whether I can access the cron-job to change it or run it - it appears to be blocked off.   

My activities are all saying they are completed, and the dashboard is saying 100% but one of my courses is not moving across to the Past tab.   

I have 2 courses the exact same setting both have 100% complete all flags are ticked, but one has moved to the Past tab and one has not.   

I have checked that the cron-jobs are running but there is no movement into the past tab.

Both courses have weighted scaling on the grade book.

I'm running the test under a student login.

Does anyone have any ideas.

Any settings I need to look at - I've looked at everything else mentioned in the forum.  It is just strange one works and the other does not.

Any guidance would be greatly appreciated.

Thanks

Joanne
Attachment Screen Shot 2018-05-09 at 9.39.40 AM.png
Attachment Screen Shot 2018-05-09 at 9.42.41 AM.png
In reply to Joanne Kirby

Re: course completion not working

by Joanne Kirby -

a few additional images FYI

Attachment Screen Shot 2018-05-09 at 9.32.51 AM.png
Attachment Screen Shot 2018-05-09 at 9.32.59 AM.png
In reply to Joanne Kirby

Re: course completion not working

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

The past tab is populated by end date of the course, not completion.

In reply to Emma Richardson

Re: course completion not working

by Joanne Kirby -

Thanks so much for your feedback.

With my course I actually don't have an end date as my students are generally new employees in a business and they could start at any point and end at any point so I have had to leave the End Date open.  I've attached the screen print below - I'm assuming this is the course end date that your referring too.

Any other suggests

Attachment Screen Shot 2018-05-12 at 3.49.38 PM.png
In reply to Joanne Kirby

Re: course completion not working

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

But have you checked the Embedded Movies course - I would bet it does have an end date...

In reply to Emma Richardson

Re: course completion not working

by Joanne Kirby -

Hi Emma

Thanks so much for the response - are you referring to the below screen?

As both my courses don't have the Date enabled for all of my URL links, score files etc.

Is there another setting I'm not aware of?

Attachment Screen Shot 2018-05-17 at 11.40.40 AM.png
In reply to Joanne Kirby

Re: course completion not working

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

No, you said that the embedded movies course had moved to the past tab, I was just wondering if it did in fact have a course end date?