Q-paper-generator is a project mainly written in Python, it's free.
q-paper-generator
A Google app Engine Application to retrive data from a spreadsheet stored in Google Docs and Generate a Question Database Using which a Question paper is generated by randomly choosing questions