I'm curious to know how the tutorial site "Rails for Zombies" did their labs. A user is required to answer a series of lab questions by typing ruby code into (what appears to be) a command line prompt to complete each lab. Upon submitting determines if they can proceed to the next lab question.
Peeking at the DOM through Firebug, it appears they're using the canvas tag- I'm assuming this is the command line, right? Also, on the Ruby side, how do they ensure that the code entered is what was required to answer the question? Or do they just have a test setup using RSpec/Cucumber?
Any help is much appreciated. :)
For the in browser code editor we're using Mozilla Bespin, now known as Skywriter. For the evaluation on the server side we are using a sandbox to run the Ruby code, as Andy Lindeman stated. In most cases as you assumed, we're using tests to ensure the code does what you're supposed to do.
It's definitely not a simple piece of code. If you're interested in using our engine to create a tutorial of sorts, please do get in touch. Gregg at EnvyLabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With