Unable to add course self completion block - solved?

Unable to add course self completion block - solved?

by John Tolle -
Number of replies: 13

Since this topic was locked: https://moodle.org/mod/forum/discuss.php?d=269512

I thought I'd supply my "hack" here.

I was able to add the block, but only while I was editing the main course (but it wasn't visible when just viewing the course).  When viewing a course activity (such as a Page), the little Self Completion block disappeared and was not available to add.  I'm using the Boost theme, and I also tried the Clean them, with Moodle v3.5.

I cheated.  Just add an HTML link and style it however you want (I made mine look like a button):

http://yourmoodleinstance.com/course/togglecompletion.php?course=10

Obviously, replace "yourmoodleinstance.com" and the course ID at the end to be whatever you want.  Now you don't need that stinking block anymore!

Average of ratings: -
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

Congrats!  You solved your problem.   Or .... did ya?

Don't mean to burst any bubble, but .... a question ... if you hacked a core code file to get desired result what will happen to that hack when one updates the code ... can't stay at version 3.5.x forever ... or when one upgrades?  Hack possibly gone.   Suggest making notes and saving those notes for re-visiting ... that's IF you hacked core code.

The only reason am mentioning ... been there ... done that ... wished I hadn't later.

'spirit of sharing', Ken



In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
Sorry for my dramatic misuse of the word "hack." There was no code modification required. All I did was add an HTML link to the course page. Granted, this won't help with activity types that do not allow you to add your own HTML links, but it's a very simple way to get around the issue.

All that said, if you happen to know how I can actually get the Self Completion block to show up when a student is actually viewing a course page, I'd be happy to implement it the right way.
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

Good!  No core hacks!  

But now a question (if I am understanding the issue) ... if am viewing a resource that has completion tracking (and maybe conditions), why would I need the ability to check completed while in the resource?  Would I be 'cheating myself' (not having to read all/spend the time in, etc.) if I had the ability to check off on it?

How often is your cron job running?

Just curious, really! smile

'SoS', Ken

In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
I'm admittedly a Moodle newb, at best. That said, I don't need any of the advanced completion tracking features for our simple needs; I only care that students can mark the thing done manually. Again, though, I'd prefer to do it the "right way", so how exactly would the student ever see the Self-completion block if it doesn't appear in the activity itself? What's the navigational path they'd take to get to the "top level" of the course so that they could actually mark it complete (without my "hack")?

Currently, the only place that I see the self-completion block is when actually editing the course (which is pointless!): http://mymoodle.com/course/edit.php?id=10

If you want to try this yourself, all I did was create a single activity format course and added a page activity to it. I don't see any way for a student to open the course without it going straight to the page itself, which refuses to allow that block to exist.
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

Think you really might not have some settings turned on/right.  Maybe!

https://docs.moodle.org/37/en/Activity_completion_settings

In the course setup is completion tracking turned on?

In the resource/activity setup itself, is Acttivity Completion turned on?
and set to Students can manually mark this activity as completed?

When viewing the course, for eache activity/reesource set up like that
there should be a ***SQUARE BOX*** ... not a 'block' ... which student
can sheck.

Then there is overall course completion settings where one could define
student must do activity A before activity B - and the lke.
date/enrolment duration,

Is Condition: Manual self Completion enabled?
Note: The self completion block should be added to the course if manual self completion is enabled.

SoS, Ken

In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
Hmm... maybe that's the issue. I created a course with only a single page activity. There is no list of activities, so, therefore, no place to put a checkbox. When you click on a course, you immediately get pushed directly into the activity.

Here's how things look:

Edit Course Completion Settings




And when editing the Activity:

Activity Completion




Here's how the Course/Activity looks to a Student:

Activity Example




And finally, this is where the "Self completion" block with "Complete course..." link appears (only when editing a course):

Course Edit with Self completion block and "Complete course..." link
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

Just tinkered myself ... single activity course ... page resource.

I did see in dashboard the course with a completion % bar at bottom of the course - 0% ... and had been in with a true Harry Potter student account.  So you might have discovered a 'feature'! :\

'SoS', Ken

In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
Cool - so I'm not crazy. Well, not in regards to this, anyhow. So what's the most appropriate way to report a bug?
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

https://docs.moodle.org/dev/Tracker_introduction

Provide steps to replicate!

'SoS', Ken

In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
Thanks again, Ken. Unfortunately, while I searched for an existing issue, there is none and yet I am not allowed to submit one myself:

"Dear Moodler, before creating a new issue you need to demonstrate that you have searched among the existing issues to see if it's already been filed. Please find a similar issue from among the open issues and either start watching it or vote for it."

If you have a friend on the inside who can flip the switch to allow me to submit it, I'd be grateful. Otherwise, I'm posting my text here so it's at least recorded somewhere.

Summary: Manual self completion of course not possible with a single activity page course
Description:
After creating a course with only a single activity (in my case, a single page, but other activities likely have the same issue) and enabling manual self-completion of both the course and activity, the self-completion checkbox is never available.

This is likely because trying to view the course immediately shows the page, which does not have the self-completion checkbox.

Steps to reproduce:

  1. Create a new course
  2. Course format: Single activity format
  3. Type of activity: Page
  4. Enable completion tracking: Yes
  5. Under Course completion:
  6. Completion requirements: Course is complete when ALL conditions are met
  7. Manual self completion: Enable
  8. Create a new page
  9. Activity completion: Students can manually mark the activity as completed
  10. View the course as a student - the page is displayed and there's no way to complete the activity or course
I've also edited the settings of the course itself and added the Self completion block that includes a "Complete course..." link.  This block only appears when editing the course; it won't appear when a student is viewing the course.

Note that I'm running Moodle 3.5.3 (Build 20181112) according to the Server/Environment menu, even though the "Affects Version/s" field doesn't have that version.  The closest one would be 3.5.6.
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by Ken Task -
Picture of Particularly helpful Moodlers

If you have a friend on the inside who can flip the switch to allow me to submit it, I'd be grateful..

Tracker requires an account to submit. 

https://tracker.moodle.org/secure/Signup!default.jspa

Therefore, no need for me.

'SoS', Ken


In reply to Ken Task

Re: Unable to add course self completion block - solved?

by John Tolle -
The account wasn't the issue; I had created one. The issue was me needing to learn to read. 

 The part of the error message that confused my Friday brain was "Please find a similar issue from among the open issues and either start watching it or vote for it." I interpreted that to mean that I wasn't yet "cool" enough to submit my own issue and would be limited to only watch and vote for issues until some point when I'd watch and/or vote for enough that it'd let me create my own.

When I took it literally and just went and watched one issue, then tried to create it again, lo and behold, it worked just fine.

FYI, I changed the course format to Topics and the Your progress checkboxes appeared as expected.

Have a good weekend, Ken, and thanks again for all your help!
In reply to John Tolle

Re: Unable to add course self completion block - solved?

by John Tolle -
For anyone stumbling on this, Moodle devs replied that they were able to reproduce the issue. It will be added to the backlog soon, and no guarantees on priority. If you'd like to vote on it:

https://tracker.moodle.org/browse/MDL-66744