Improved negative variable handling in the tokenizer. Updated the tolerance checking in the main program.

This commit is contained in:
2020-04-26 19:11:01 -05:00
parent 917b58ee87
commit 5a585cf6f8
2 changed files with 7 additions and 2 deletions
+1 -2
View File
@@ -169,8 +169,7 @@ for r in res:
t = tokenizer.replace_variables(tokens, list(r))
#tokenizer.print_token_list(t)
result = calc_engine.calculate_results(t)
tol = int(exp.wrong_response * tolerance + exp.wrong_response)
if result <= tol and result >= int(exp.wrong_response - exp.wrong_response * tolerance):
if result <= int(exp.wrong_response(1 + tolerance)) and result >= int(exp.wrong_response(1 - tolerance)):
if not result in answers:
answers[result] = t
#if result <= tol and result >= int(exp.wrong_response - exp.wrong_response * tolerance):