# L-12.5 MCS 260 Mon 14 Jul 2014 : a quiz
"""
This program illustrates bottom-up design
of an automated multiple choice quiz.
"""

import questions
import dialogue
from random import shuffle

TLY = [0, 0]
while True:
    (QST, ANS) = questions.generate()
    shuffle(ANS)
    dialogue.show_question(QST, ANS)
    CHC = dialogue.prompt_choice(len(ANS))
    EVA = questions.evaluate(ANS, CHC)
    dialogue.show_outcome(EVA)
    TLY = questions.update_tally(TLY, EVA)
    MORE = raw_input('continue ? (y/n) ')
    if MORE != 'y':
        break
dialogue.show_tally(TLY)
