cleaning up answer parsing for free form fields

EmailTemplateFixes
Griffin Caprio 2014-12-09 18:12:29 -06:00
parent 79ba0cfdb6
commit 000431b208
1 changed files with 2 additions and 3 deletions

View File

@ -986,6 +986,8 @@ def dep_check(expr, runinfo, answerdict):
if actual_answer is None:
actual_answer = u''
if type(actual_answer) == type(list()):
actual_answer = actual_answer[0]
if check_answer[0:1] in "<>":
try:
actual_answer = float(actual_answer)
@ -1004,13 +1006,10 @@ def dep_check(expr, runinfo, answerdict):
return actual_answer < check_value
if check_answer.startswith(">"):
return actual_answer > check_value
if type(actual_answer) == type(list()):
actual_answer = actual_answer[0]
if check_answer.startswith("!"):
if actual_answer == '':
return False
return check_answer[1:].strip() != actual_answer.strip()
return check_answer.strip() == actual_answer.strip()