# L-22 MCS 260 : a quiz
"""
This program illustrates bottom-up design
of an automated multiple choice quiz.
"""

from random import shuffle
import questions
import dialogue

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 = input('continue ? (y/n) ')
    if MORE != 'y':
        break
dialogue.show_tally(TLY)
