script content stripped for non-admins

script content stripped for non-admins

by Conn Warwicker -
Number of replies: 0
Picture of Core developers Picture of Plugin developers

Moodle 3.5.3 (Blackboard-hosted)


Client is using the Lesson module to create a sort of interactive "slides" system, however they also use the same Lesson module for standalone content (ie. just 1 page in the lesson), and as such they have hidden the "Continue" button which appears at the bottom, as it was confusing people on the standalone ones where there was nothing to continue onto.


So for the ones with multiple pages, I added this script to the bottom of each page's HTML, to show the button again:

<script>

$(document).ready( function(){

$('.path-mod-lesson .branchbuttoncontainer').css('display', 'block').css('visibility', 'visible').css('text-align', 'center');

} );

</script>


This was working fine before I left, but apparently now it's not working.

I've checked and as both an admin and as a teacher, when I edit the page, the script is still there in the HTML, so it's not being stripped out of the editor. 

However, when I actually view the lesson page, the <script> section is stripped entirely from the HTML of the page, if I am an teacher or a student. It still appears if I am an admin. 


Has something changed in recent Moodle versions which would strip scripts from user generated content, for non-admin users? And if so, is there a setting to override that? If not, does anyone have any other idea what might be happening?


Thanks.



Average of ratings: -