def hello():

    banner()
    print(
        "\t******************************************************************\n"
    )

    print(
        "\tSELECT ANY ONE CHOICE:\n"
        "\t        1. Start Quiz\n"
        "\t        2. Resume Quiz\n"
        "\t        3. Feedback\n"
        "\t        4. About Application\n"
        "\t        5. Exit\n"
        "\tENTER YOUR CHOICE HERE:- ",
        end='')

    var = int(input())

    if var == 1:
        start_quiz()
    elif var == 2:
        check_logs()
    elif var == 3:
        feedback()
    elif var == 4:
        about_sec()
    elif var == 5:
        print("Thank you Using!")
        sys.exit(0)
def start_quiz():
    banner()

    print("\n\t~ If You Are New User, "
          "Please Sign In First,"
          "And Then Log In..\n")

    print(
        "\tSelect Any One Option: \n"
        "\t     1. Sign In \n"
        "\t     2. Log In \n"
        "\t     3. Exit\n"
        "\tEnter Your Choice:- ",
        end='')

    check = int(input())

    if check == 1:
        check_logs()
    elif check == 2:
        check_logs()
    elif check == 3:
        sys.exit(0)
    else:
        print("\tEnter Valid Key (i.e. 1, 2 or 3)")
Пример #3
0
def login():
    banner()

    print(
        "\tEnter registered Email id and Password,\n"
        "\tFor Log In:\n"
        "\tENTER YOUR E-MAIL ID:",
        end='')
    username = input()

    password = getpass.getpass("\tENTER YOUR PASSWORD:"******"username").read() and password == open(
            "password").read():
        print("\tSuccessful login")
        print("\n\tWant to Start quiz (Press 1/0) ..! :-", end='')
        i = int(input())
        if i == 1:
            q_n_a()
        else:
            sys.exit(0)

    else:
        print(
            "\t\nThe email and password you entered did not match our records.\n "
            "\tPlease double-check and try again.\n")
        print("\tWant to try again or Exit? ( PRESS: 1 - RETRY, 0 - EXIT ):- ",
              end='')

        num = int(input())

        if num == 1:
            login()
        else:
            sys.exit(0)
def feedback():

    banner()

    f = open("Feedback.txt", "a")
    print("\t\nPlease Enter Your Feedback: ", end='')
    f.write(input())
    print("Thank You for your Feedback!")
Пример #5
0
def q_n_a():
    banner()

    choice = get_quiz_choice()
    quiz_name = questions[choice - 1]
    print("\nYou chose the {}".format(quiz_name))
    print(end='')
    quiz_questions = quiz[quiz_name]
    for q in quiz_questions:
        print("\tYour answer is: {}\n".format(str(get_answer(q[0], q[1]))))
    print("\n\tYour SCORE: {}".format(result))
    print("\n\tHOPE U ENJOYED! :-)")
Пример #6
0
def q_n_a():
    banner()

    choice = get_quiz_choice()
    quiz_name = questions[choice - 1]
    print("\nYou chose the {}".format(quiz_name))
    print(end='')
    quiz_questions = quiz[quiz_name]
    for q in quiz_questions:
        print("\tYour answer is: {}\n".format(str(get_answer(q[0], q[1]))))
    print("\n\tYour SCORE: {}".format(result))
    print("\n\tHOPE U ENJOYED! :-)\n")
    g = input("1.Login Page:/2.Restart quiz:/{3-9}Exit :\n") 
    if g=="1":
        start_quiz()
    elif g=="2":
         q_n_a()
    else:
        print("Exit")
Пример #7
0
def make_account():
    banner()

    print("\tWELCOME,\n" "\tFor Sign In:\n" "\tENTER YOUR E-MAIL ID:", end='')

    em = input()

    filename = "username"
    with open(filename, "w") as f:
        f.write(em)

    pswd = getpass.getpass("\tENTER YOUR PASSWORD:"******"password"
    with open(filename, "w") as f:
        f.write(pswd)
    print("\n\tWant to Start quiz (Press 1/0) ..! :-", end='')
    i = int(input())
    if i == 1:
        q_n_a()
    else:
        sys.exit(0)
def about_sec():
    banner()

    print(
        "\n  This is basic command line quiz application created in Python Programming Language.\n"
        "\n  THIS APPLICATION WORKS PROPERLY ON TERMINAL.\n"
        "\t  Some basic features:\n"
        "\t  1. Divided into 3 Levels.\n"
        "\t  (i.e. Beginner, Basics, Advance)\n"
        "\t  2. User can log in and log out.\n"
        "\t  3. Only one can user this \n"
        "\t  4. User can resume the quiz.\n"
        "\n\n   As this application is in early stage so some features/options may not work properly.\n"
        "   We are working on these features/options,and we will send update soon,\n\n"
        "   Some Bugs That u should know about are Listed below:\n"
        "   \t    -> Resume Quiz option may not work properly.\n\n"
        "   \t    -> Each levels have only 3 questions.\n\n"
        "   \t    -> You can only write ( until and unless you press 'ENTER KEY') feedback,\n"
        "   \t       After that it will automatically exited.\n"
        "\n\t\t\t\t\t\t\tDeveloped by Somyaranjan Rout.\n"
        "   ---------------------------------------------------------------------------------------\n"
        "\t\t\t\t\t\t\tHpoe you Like.\n"
        "\t\t\t\t\t\t\tThank You For Using!.")
Пример #9
0
from communication import *
from Alert import *
import serial
from Banner import banner

interface="com7"
if __name__ == '__main__':
    banner()
    try:
        ser = connect_to_serial(interface)
        while True:
            sensor = read_from_serial(ser)
            print(sensor)
            alert_sound()
            msg=alerts[sensor]

            popupmsg(msg,sensor)

    except serial.SerialException:
        print("connection refused")