cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vikas1018
Community Participant

Add javascript to quiz description

Jump to solution

Hello,

I am trying to add simple javascript to quiz description to control description behavior under different situations. I am aware that custom javascript can be added by admin in entire course to accomplish this task but we do not want to take this approach due to some security reasons.

So when I tried adding JS in description(using html editor), It seems canvas striped script tags of javascript which made browser to think as plain text/html. This is what I added in description, instead of alerting, "It works" text is shown. am I missing something on this? is there any workaround?

<script type="text/javascript">alert("It works");</script>

1 Solution

Accepted Solutions
Stefanie
Community Team
Community Team

 @vikas1018 , since you're trying to add this at the course/quiz level, only those tags and attributes that are listed in the Canvas HTML Editor Whitelist will be applied to your code in the Rich Content Editor (RCE); anything else will be stripped out, as you've noted.

View solution in original post

2 Replies
Stefanie
Community Team
Community Team

 @vikas1018 , since you're trying to add this at the course/quiz level, only those tags and attributes that are listed in the Canvas HTML Editor Whitelist will be applied to your code in the Rich Content Editor (RCE); anything else will be stripped out, as you've noted.

View solution in original post

vikas1018
Community Participant

Thank you, Now I have confirmation that my approach will not work.