From 2f29d85efc2dc16e74d5e59d4b6bd7a559abc2ae Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 20 Feb 2013 16:22:22 -0500 Subject: [PATCH] Finish function to get eta value --- .../open_ended_grading_classes/openendedchild.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py index 6b7954e198..c79d57b650 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py @@ -456,6 +456,17 @@ class OpenEndedChild(object): except: pass - + success = response['success'] + if isinstance(success, basestring): + success = (success.lower()=="true") + + if success: + eta = controller_query_service.convert_seconds_to_human_readable(response['eta']) + eta_string = "Please check back for your response in approximately " + else: + eta_string = "" + + return eta_string +