The weight questionnaire is a solid example of how we create a fairly complex questionnaire. It is heavily commented so that you can follow everything that goes on. After reading the documentation feel free to download the file and modify it according to your needs.