# L-22 MCS 260 Wed 3 Mar 2010 : a quiz # # this program illustrates bottom-up design # of an automated multiple choice quiz import questions import dialogue t = [0,0] while True: (q,a) = questions.generate() s = questions.shuffle(a) dialogue.show_question(q,s) c = dialogue.prompt_choice(len(s)) e = questions.evaluate(s,c) dialogue.show_outcome(e) t = questions.update_tally(t,e) more = raw_input('continue ? (y/n) ') if more != 'y': break dialogue.show_tally(t)