Is there any way to include a javascript snippet in the feedback options? In particular, I would like to hide/show certain css elements depending on whether or not the user responded correctly. I tried enclosing it in the feedback tag of the question XML using a <script> tag, but that didn't work. Any suggestions or alternate solutions would be appreciated.

Thanks for an amazing module, by the way!

Comments

jvdkolk’s picture

Script-tags can bring serious security issues I think.

Can you solve your problem with this - brand new - feature: http://drupal.org/node/1231310#comment-4905860?

HylkeVDS’s picture

Javascript certainly is a security risk, so it depends on how well you trust your teachers.

You can add the "script" tag to the long list in XmlLib.inc.php, that way ClosedQuestion won't cut it out. If the text filters also do not remove it then it should then just work.

spazfox’s picture

Status: Active » Closed (works as designed)

Thanks for the suggestion. Adding the "script" tag to XmlLib.inc.php did not work for me, but I was able to do a little work around (that does not compromise the security of this module as much) by using the insert_block module to include blocks that contain the relevant javascript code as needed.