bypass "end of lesson reached" screen, or link to home rather than next activity?

bypass "end of lesson reached" screen, or link to home rather than next activity?

by tim st.clair -
Number of replies: 2
Picture of Plugin developers

In my old site (Moodle 2.4) the "end of lesson" action for a button on a lesson activity took me to the course home.

In my new site (Moodle 2.7.7, can't upgrade at this time) the action takes me to an "end of lesson" screen (which also has a different design - link text rather than a button like on all other lesson pages, I can fix that in css). Is it possible to remove this extraneous screen without affecting the grade?

Here's an image to help describe what I see. In each, the "Home" button uses the "end of lesson" jump.

Flowchart showing varying behavior

Is there a way to avoid seeing the "congratulations" screen?

Is there a reason a jump button can't link to an arbitrary page, like the course homepage?

Average of ratings: -
In reply to tim st.clair

Re: bypass "end of lesson reached" screen, or link to home rather than next activity?

by Jean-Michel Védrine -

Hello Tim,

I was not aware of the old behaviour you describe but I can assure you that the behaviour you describe for Moodle 2.7 is the same since several years.

By the way I know you say you can't upgrade but I must underline that 2.7 is out of support except for security bugs, so even if you find a bug in lesson, I will not be able to fix it for your Moodle version sad

The "end of lesson"" page (in fact it's not a real "page", there is no record for it in the database) has a very special role and a lot of things happens in the background when the student reach it:

  • the grade is updated in the gradebook
  • activity completion is updated
  • the timer is stopped and there is a check to see if the student ran out of time
  • ...

So no it is not possible to bypass this page.

Of course you can create a new issue in the tracker so that we introduce a new option and modify the code so that teachers can select to not show this page, in that case, all the previous actions would be done and then rather than displaying something, the code would redirect the user to the course page. But I must underline that as this is an API change, it could only be done for Moodle 3.0 or later and could not been backported to previous versions.

Also internally the value of each jump is stored as a constant (for instance end of lesson is -9) so obviously if we want to store a url here it would need a rewrite of all the lesson code for jumps. This is unlikely to happen.

The only way to link to an arbitrary page is to include a link in one of your lesson page's content

About the "end of lesson" page, it has already been suggested that teachers should be able to customize it (for instance the "Congratulations ... " message is not suitable for all lessons), see MDL-45657, my concern is on how to do that without adding more lesson's settings because I think the lesson has already too much settings and that is a big problem for teachers when creating lessons

In reply to Jean-Michel Védrine

Re: bypass "end of lesson reached" screen, or link to home rather than next activity?

by tim st.clair -
Picture of Plugin developers

Ok, thank you. Excellent information in the reply. I can't work out what setting we previously had to made us avoid seeing this screen in the previous version, but it doesn't appear for anyone, and yet we still get a grade set. Something odd, I'm sure.

If the "congratulations" page were able to be formatted using the standard moodle text entry tool (and fall back on the current wording), rather than having to hack about in the language pack settings, then I think it would solve a number of peoples issues with this page.