[Chicago] Testing Submitted Python Scripts

Walter Askew waltaskew at gmail.com
Tue Dec 7 05:27:40 CET 2010

I'm going to be teaching an Intro to Programming class at Pumping Station One sometime after the holiday stuff clears up, and I'll be using Python to impart the art of computer programming.  I'll probably post again once I'm about to fire up the class to try get the word out and grab some more students.

I'm working on a website for the class, and I'd like to have a way to distribute homework to the students and then validate the programs they write.  I'm trying to think of a clever way to do this, but I can't quite come up with something I'm happy with.

I think the best thing to do would be to distribute a tester program, let the students run it, and on a successful check of the code they've written pop out a random-looking code they can enter in the website to prove they've solved the problem.  I'd like this because I'd be able to avoid the whole 'execution of foreign code on my server' thing.  

That'd be great, but I can't really come up with a clever way to generate a secret code without exposing the secret code itself in the tester program I'd be distributing.  I don't really want to get into distributing non-source tester programs, because the source of the tester could be useful to the students and I'd have to get involved with distributing non-source python programs.

The other alternative is to let students upload their programs and do the validation on the server.  If I do this I'll need to get involved with a bunch of security precautions -- I'm thinking a chroot with nothing but the read-only binaries for the python interpreter -- but I'm appropriately concerned with executing arbitrary code on my server.

What would you guys do in this situation?  Is there a clever solution I'm overlooking?  Any advice in implementing the solutions I've put forward?  I'm doing the site in Django, so bonus points for any Django snippets.

Thanks folks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20101206/09e76b9a/attachment.html>

More information about the Chicago mailing list