Exemple #1
0
from model.Terminal import Terminal
print(Terminal.paintHeader(Terminal.writeHeader('Welcome to the Quiz!')))
print('Options:')
print('\t- To give a quiz, write "go"')
print('\t- To exit, write "quit"')
while True:
    user_input = input("Enter option: ")
    if user_input == 'quit':
        print(Terminal.paintFooter(Terminal.writeFooter('Exitting')))
        break
    elif user_input == 'go':
        print(Terminal.paintBlue("Starting quiz..."))
    else:
        print(Terminal.paintFail("Invalid input, try again..."))
Exemple #2
0
def trueFalseColored(input_bool):
    return Terminal.paintGreen(
        input_bool) if input_bool else Terminal.paintFail(input_bool)
Exemple #3
0
                        "correctNess": True
                    })
                    break
                elif user_input == 'n':
                    all_answerDicts.append({
                        "answer": new_answer,
                        "correctNess": False
                    })
                    break
                elif user_input == 'quit':
                    print("Leaving correct answer or not")
                    break
                else:
                    print(
                        Terminal.paintFail(
                            "Invalid input, please enter [y/n] or write [quit] to exit."
                        ))

            while True:
                user_input = input("Add another? [y/n]: ")
                if user_input == 'n':
                    user_input = 'quit'
                    break
                elif user_input == 'y':
                    break
                else:
                    print(
                        Terminal.paintFail(
                            "Invalid input, please enter [y/n] or write [quit] to exit."
                        ))
            if user_input == 'quit':