Jeff Rush wrote: > > For another solution, I wonder whether you could make use of the new Abstract > Syntax Tree (AST) in Python 2.5, where you convert the source of an attempt > into an abstract data structure, anonymize the method/variable/class names and > compare the tree against a correct solution. It would let you quickly handle > those students who solved it in a conformist way, and then you'd need to > manually review the rest for creatively solving it another way. ;-)
You could attempt that kind of solution using previous versions of Python (and the compiler module), but as soon as you want to compare two different ASTs - and I think that unless there's only one obvious solution, they won't be identical - then you need to descend into a world of program transformations that Python doesn't encourage. It's probably no coincidence that the functional programming people were probably the only people trying this kind of automatic grading back when I was a student. Paul -- http://mail.python.org/mailman/listinfo/python-list