PencilCode/pencilcode-site — pull request #77 by davidbau (2014-05-27 17:01:49+00:00)
Title: Enhance the PencilCodeEmbed object with a setPreviewScript and eval

pce.setPreviewScript([script, script, script]) sets up the embeeded pencilcode to include extra script tags when running the code. [{text: "alert('hi');"}] is for an inline script and [{src:"/jquery.js"}] is for a script src=.

pce.eval("expression", callback) executes an eval in the student's frame and sends the result to a callback.

Together these are useful for setting up framed scenarios that are more "active" than just a plain piece of code to run.