For multistep openended problems after moving to a openendedmodule step keep trying to resend submission to grader until it succeeds.

ORA-197
This commit is contained in:
Usman Khalid
2014-01-15 17:42:48 +05:00
parent b21d606494
commit d2ede8339a
3 changed files with 107 additions and 15 deletions

View File

@@ -71,10 +71,15 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
self._parse(oeparam, self.child_prompt, self.child_rubric, system)
# If there are multiple tasks (like self-assessment followed by ai), once
# the the status of the first task is set to DONE, setup_next_task() will
# create the OpenEndedChild with parameter child_created=True so that the
# submission can be sent to the grader. Keep trying each time this module
# is loaded until it succeeds.
if self.child_created is True and self.child_state == self.ASSESSING:
self.child_created = False
self.send_to_grader(self.latest_answer(), system)
self.child_created = False
success, message = self.send_to_grader(self.latest_answer(), system)
if success:
self.child_created = False
def _parse(self, oeparam, prompt, rubric, system):
'''

View File

@@ -283,7 +283,7 @@ class OpenEndedChild(object):
'child_state': self.child_state,
'max_score': self._max_score,
'child_attempts': self.child_attempts,
'child_created': False,
'child_created': self.child_created,
'stored_answer': self.stored_answer,
}
return json.dumps(state)