import cgitb; cgitb.enable()
from web_form import *

# create the form
form = WebForm("6.095 'IQ' test", "score_iq_test.py", colorscheme="yellow", show_numbers=True)

form.new_section("IQ Test")

# question 1
form.begin_question()

form.write_text("Which number should come next in the following series?")

form.new_paragraph()
form.write_text("1, 4, 9, 16, 25", typewriter=True)

form.new_paragraph()
form.add_input_text("q1")

form.end_question()

# question 2
form.begin_question()

form.write_text("Which number should come next in the following series?")

form.new_paragraph()
form.write_text("3, 5, 8, 13, 21", typewriter=True)

form.new_paragraph()
form.add_input_text("q2")

form.end_question()

# question 3
form.begin_question()

form.write_text("Which number does not belong?")

form.new_paragraph()
form.write_text("04, 32, 144", typewriter=True)
form.newline()
form.write_text("17, 28, 122", typewriter=True)
form.newline()
form.write_text("18, 64, 188", typewriter=True)
form.newline()
form.write_text("32, 14, 202", typewriter=True)
form.newline()

form.new_paragraph()
form.add_input_text("q3")

form.end_question()

# question 4
form.begin_question()

form.write_text("Which is the odd one out?")

choices = ["cat", "lion", "leopard", "sparrow"]

form.new_paragraph()
form.add_input_multichoice("q4", choices, choices, newlines=True)

form.end_question()


# print out the HTML
form.print_html()