cor = 0
questions = [
    "1. When watching CollegeBoard videos, what should you do?\n\ta) Listen to music\n\tb) Work on homework from other subjects\n\tc) Take notes\n\td) Work on your fastpages site",
    "2. When taking practice tests, what should you NOT do?\n\ta) Look up questions you don't know\n\tb) Make test corrections when finished\n\tc) Take note of the prompt and format of the questions\n\td) Time yourself",
    "3. CollegeBoard videos are fine and all, but where else can you find videos?\n\ta) YouTube\n\tb) Khan Academy\n\tc) Opencast\n\td) Echo360",
    "4. What are the conditions of the test?\n\ta) 1 hour, 40 MC\n\tb) 1 hour, 60 MC\n\tc) 1 hour and 30 minutes, 80 MC\n\td) 2 hours, 70 MC",
    "5. On the Create Task, what should you try to do?\n\ta) Make a basic, easy-to-understand program like a GPA calcualtor\n\tb) A program which meets all Create Task rubric points\n\tc) Ignore past examples on CollegeBoard\n\td) Copy code from other people"
]
def question_loop(i):
    global cor
    global quesnum
    if i == 0:
        quesnum = 0
    if i < len(questions):
        record = questions[i]
        global add
        add = ask_question(record)
        if add == 1 or add == 0:
            cor += add
        elif add == 2:
            print("That is an invalid response! Try again.")
            question_loop(i)
        else:
            print("ERROR")
            return
        i += 1
        quesnum = i
        question_loop(i)
    return
def ask_question(question):
    print(question)
    global ans
    ans = input()
    r = ans_check()
    return r
def ans_check():
    if quesnum == 0:
        if ans == "a" or ans == "A" or ans == "a)" or ans == "A)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "c) Take notes".')
            return 0
        elif ans == "b" or ans == "B" or ans == "b)" or ans == "B)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "c) Take notes".')
            return 0
        elif ans == "c" or ans == "C" or ans == "c)" or ans == "C)":
            print('Excellent job, "c)" is correct!')
            return 1
        elif ans == "d" or ans == "D" or ans == "d)" or ans == "D)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "c) Take notes".')
            return 0
        else:
            return 2
    if quesnum == 1:
        if ans == "a" or ans == "A" or ans == "a)" or ans == "A)":
            print('Excellent job, "a)" is correct!')
            return 1
        elif ans == "b" or ans == "B" or ans == "b)" or ans == "B)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "a) Look up questions you don\'t know".')
            return 0
        elif ans == "c" or ans == "C" or ans == "c)" or ans == "C)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "a) Look up questions you don\'t know".')
            return 1
        elif ans == "d" or ans == "D" or ans == "d)" or ans == "D)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "a) Look up questions you don\'t know".')
            return 0
        else:
            return 2
    if quesnum == 2:
        if ans == "a" or ans == "A" or ans == "a)" or ans == "A)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) Khan Academy".')
            return 0
        elif ans == "b" or ans == "B" or ans == "b)" or ans == "B)":
            print('Excellent job, "b)" is correct!')
            return 1
        elif ans == "c" or ans == "C" or ans == "c)" or ans == "C)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) Khan Academy".')
            return 1
        elif ans == "d" or ans == "D" or ans == "d)" or ans == "D)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) Khan Academy".')
            return 0
        else:
            return 2
    if quesnum == 3:
        if ans == "a" or ans == "A" or ans == "a)" or ans == "A)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "d) 2 Hours, 70 MC".')
            return 0
        elif ans == "b" or ans == "B" or ans == "b)" or ans == "B)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "d) 2 Hours, 70 MC".')
            return 0
        elif ans == "c" or ans == "C" or ans == "c)" or ans == "C)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "d) 2 Hours, 70 MC".')
            return 1
        elif ans == "d" or ans == "D" or ans == "d)" or ans == "D)":
            print('Excellent job, "d)" is correct!')
            return 1
        else:
            return 2
    if quesnum == 4:
        if ans == "a" or ans == "A" or ans == "a)" or ans == "A)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) A program which meets all Create Task rubric points".')
            return 0
        elif ans == "b" or ans == "B" or ans == "b)" or ans == "B)":
            print('Excellent job, "b)" is correct!')
            return 1
        elif ans == "c" or ans == "C" or ans == "c)" or ans == "C)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) A program which meets all Create Task rubric points".')
            return 1
        elif ans == "d" or ans == "D" or ans == "d)" or ans == "D)":
            print('I\'m sorry, that is incorrect!\nWe were looking for "b) A program which meets all Create Task rubric points".')
            return 0
        else:
            return 2
question_loop(0)

per_score = (cor / 5) * 100
print("You scored " + str(cor) + "/5! That's " + str(per_score) + "%.")
if cor <= 3:
    print("Unfortunately, you need 80.0" + "%" + " or more to pass the quiz.\nPlease review the \"How I Got a 5!\" article on the APCSP page and try again.")
else:
    print("You passed! Congratulations! Now it's time to pass the real test...")
1. When watching CollegeBoard videos, what should you do?
	a) Listen to music
	b) Work on homework from other subjects
	c) Take notes
	d) Work on your fastpages site
Excellent job, "c)" is correct!
2. When taking practice tests, what should you NOT do?
	a) Look up questions you don't know
	b) Make test corrections when finished
	c) Take note of the prompt and format of the questions
	d) Time yourself
I'm sorry, that is incorrect!
We were looking for "a) Loop up questions you don't know".
3. CollegeBoard videos are fine and all, but where else can you find videos?
	a) YouTube
	b) Khan Academy
	c) Opencast
	d) Echo360
Excellent job, "b)" is correct!
4. What are the conditions of the test?
	a) 1 hour, 40 MC
	b) 1 hour, 60 MC
	c) 1 hour and 30 minutes, 80 MC
	d) 2 hours, 70 MC
Excellent job, "d)" is correct!
5. On the Create Task, what should you try to do?
	a) Make a basic, easy-to-understand program like a GPA calcualtor
	b) A program which meets all Create Task rubric points
	c) Ignore past examples on CollegeBoard
	d) Copy code from other people
Excellent job, "b)" is correct!
You scored 4/5! That's 80.0%.
You passed! Congratulations! Now it's time to pass the real test...