General help

 
 
Picture of tim st.clair
2.3 - Adding surveymonkey code; trustedcontent doesn't seem to work
 

I've logged in as the admin of my site, gone to a course, added a "page" activity and pasted in the surveymonkey code into its content using the moodle editor. This is a div, with a script src->surveymonkey.com in it. It dynamically draws what it needs - in theory.

The script is stripped.

I've tried these things with no joy

  • making my page edit text instead of html, in case the editor was tripping up on it
  • following through with https://moodle.org/mod/forum/discuss.php?d=227561 to see if I could embed the code and wrap the usual cdata block on it
  • adding my admin user as a member of "manager", since manager role has site/trustedcontent permission enabled (and I checked it).

Content gets rendered to the page like this:

<div id="surveyMonkeyInfo"><div>
<script src="about:blank">// <![CDATA[

// ]]></script>
</div>Create your free online surveys with <a href="https://www.surveymonkey.com/">SurveyMonkey</a> , the world's leading questionnaire tool.</div>

So the src parameter of the script tag is taken out altogether, even though I'm a site administrator and a manager.

 
Average of ratings: -
Picture of Richard Bakos
Re: 2.3 - Adding surveymonkey code; trustedcontent doesn't seem to work
 

Not sure if you already figured this out but, using the "Purge all caches" function found at Administration -> System Administration -> Development should set the source to the correct location. From my experience, you need to do that every time you add a script resource using the WYSIWYG... Couldn't tell you why that works though... 

Another method is for the teacher or admin to edit their profile settings and change the field "When editing text" to "Use standard web forms". This will turn the WYSIWYG editor off and prevent anything from getting stripped out... 

 
Average of ratings: -