Detecting when edit mode is on and an activity is being edited

Detecting when edit mode is on and an activity is being edited

by Nathan Wallis -
Number of replies: 0

Hi, 

I have written an editor (HTML helper) that is available to our learning designers when they are editing a course or an activity. 

Rather than implementing this as a tool that is launched via the text editor button, I have included this as part of the course format templates that is injected on the page that is running our in house course format. 

I am familiar with the following code that works on after they first turn on 'edit mode', but this condition isn't satisfied if they click on "Edit Settings" of an individual activity.   

if ($PAGE->user_is_editing()) { }

Anyone have any idea of the safest way to detect if course content is being edited?  I would have thought editing mode would be sufficient until they turn edit mode off at a later date, but that doesn't appear to be the case. 

I should also mention this is for Moodle 3.11

Thanks,... 

Average of ratings: -