Python in the browser (Skulpt/Codeskulptor) + tests?
This is probably an insecure solution but it works for my current purposes. My PHP script calls shell_exec('python3 -c "X") where X is the user-supplied code appended with the code I use for testing, e.g. calling their created functions etc.
For a school project I want to make a small Codecademy-like site that teaches programming for beginners. I want the site to teach Python as it has a syntax that is suitable for beginners to learn, and for this reason I found Skulpt to be useful as it has both browser text and drawing output capabilities.
My question now though is, is there some way to integrate testing with the code the user writes, so the site can mark the code as correct or incorrect? E.g. a task could be to write a function that returns the nth fibonacci number, and the site runs the user-provided code and checks for instance that their fib(5) returns 8.
How does CodingBat do it?