Commit fd756b9f by Julian Arni

Only refresh when waitfor is an attribute.

  Silly workaround for the fact that tests set the answers, but not the inputs,
  so refreshAnswers changes the test result even though it shouldn't.
parent 386029be
...@@ -145,13 +145,13 @@ class @Problem ...@@ -145,13 +145,13 @@ class @Problem
if ($(inp).is("input[waitfor]")) if ($(inp).is("input[waitfor]"))
try try
$(inp).data("waitfor")() $(inp).data("waitfor")()
@refreshAnswers()
catch e catch e
if e.name == "Waitfor Exception" if e.name == "Waitfor Exception"
alert e.message alert e.message
else else
alert "Could not grade your answer. The submission was aborted." alert "Could not grade your answer. The submission was aborted."
throw e throw e
@refreshAnswers()
### ###
...@@ -164,7 +164,6 @@ class @Problem ...@@ -164,7 +164,6 @@ class @Problem
check_fd: => check_fd: =>
Logger.log 'problem_check', @answers Logger.log 'problem_check', @answers
# If there are no file inputs in the problem, we can fall back on @check # If there are no file inputs in the problem, we can fall back on @check
if $('input:file').length == 0 if $('input:file').length == 0
@check() @check()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment