Exemplo n.º 1
0
q3 = Question(1444130, "DF2", ("0:0:0"), ("1:1:0"), ("0:0:1"), ("1:1:0"))
q4 = Question(1444130, "DF3", [("1:1:0"), ("0:0:1"), ("7:7:0"), ("-1:-1:0")], [("5:5:1"), ("2:2:0")])
q5 = Question(1444130, "DF3", [("sin(x)"), ("1:1:0")], [("2:2:0")])
q6 = Question(1444130, "DF4", [("2:2:0")], [("1:1:0"), ("1:1:0")])
q7 = Question(1444130, "DF5", ("5:5:0"), ("2:2:0"), ("-3:-3:1"), ("0:0:0"))
q8 = Question(1444130, "IN1", ("1:1:0"), ("3:3:1"), ("2:2:1"))

"""Questions made up of type and of variables representing a/b/c/d/e. First variable
represents the point for question 3, solving the gradient"""
"""Takes the question type and makes parser with answer passed to it"""
"""For the marker it passed it the question and parser"""

p1, m1 = ParserMarkerFactory.create_parser_marker(q1.getQuestionType(), "2x+2", q1)
p2, m2 = ParserMarkerFactory.create_parser_marker(q2.getQuestionType(), "cos(x)", q2)
p3, m3 = ParserMarkerFactory.create_parser_marker(q3.getQuestionType(), "0", q3)
p4, m4 = ParserMarkerFactory.create_parser_marker(q4.getQuestionType(), "20x^3+6x^2+70x+9", q4)
p5, m5 = ParserMarkerFactory.create_parser_marker(q5.getQuestionType(), "2*(sin(x) + x*(cos(x)))", q5)
p6, m6 = ParserMarkerFactory.create_parser_marker(q6.getQuestionType(), "-2/(x+1)^2", q6)
p7, m7 = ParserMarkerFactory.create_parser_marker(q7.getQuestionType(), [[-0.6, 1/3],[1, -1]], q7)
p8, m8 = ParserMarkerFactory.create_parser_marker(q8.getQuestionType(), "(x^3)/3+(3x^2)/2+2x", q8)
markers = [m1, m2, m3, m4, m5, m6, m7, m8]


t = Totaller(markers)


student_data = {"id": 123456, "name": "Poseid-son", "year": 3}
h = Handler(student_data, t)

h.push_to_database()