Commit 989a1b62 by Usman Khalid

If unable to send submission to grader store it instead.

ORA-197
parent d2ede833
......@@ -282,7 +282,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
message = "Successfully saved your submission."
if error:
success = False
message = 'Unable to send your submission to grader. Please try again later.'
message = 'Unable to submit your submission to grader. Please try again later.'
log.error("Unable to submit to grader. location: {0}, error_message: {1}".format(
self.location_string, error_message
))
......@@ -702,6 +702,8 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
success, error_message = self.send_to_grader(data['student_answer'], system)
if not success:
message = error_message
# Store the answer instead
self.store_answer(data, system)
else:
self.new_history_entry(data['student_answer'])
self.change_state(self.ASSESSING)
......
......@@ -363,8 +363,10 @@ class OpenEndedModuleTest(unittest.TestCase):
)
self.assertFalse(response['success'])
self.assertNotEqual(self.openendedmodule.latest_answer(), submission)
self.assertEqual(self.openendedmodule.stored_answer, submission)
state = json.loads(self.openendedmodule.get_instance_state())
self.assertEqual(state['child_state'], OpenEndedModule.INITIAL)
self.assertEqual(state['stored_answer'], submission)
def update_score_single(self):
self.openendedmodule.new_history_entry("New Entry")
......
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