From 125bbbf934c202bbea27794ad8afdbb9b2d3e94f Mon Sep 17 00:00:00 2001 From: kimth Date: Fri, 10 Aug 2012 15:25:07 -0400 Subject: [PATCH] Spinner on waiting for queue --- common/lib/capa/capa/inputtypes.py | 10 ++++------ common/lib/capa/capa/templates/filesubmission.html | 8 +++----- common/lib/capa/capa/templates/textbox.html | 10 ++++------ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index ea60b3b7bd..0c47892598 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -309,15 +309,14 @@ def filesubmission(element, value, status, render_template, msg=''): eid = element.get('id') # Check if problem has been queued - queued = '' queue_len = 0 if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue - queued = 'true' + status = 'queued' queue_len = msg msg = 'Submitted to grader. (Queue length: %s)' % queue_len context = { 'id': eid, 'state': status, 'msg': msg, 'value': value, - 'queued': queued, 'queue_len': queue_len + 'queue_len': queue_len } html = render_template("filesubmission.html", context) return etree.XML(html) @@ -342,10 +341,9 @@ def textbox(element, value, status, render_template, msg=''): if not value: value = element.text # if no student input yet, then use the default input given by the problem # Check if problem has been queued - queued = '' queue_len = 0 if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue - queued = 'true' + status = 'queued' queue_len = msg msg = 'Submitted to grader. (Queue length: %s)' % queue_len @@ -359,7 +357,7 @@ def textbox(element, value, status, render_template, msg=''): 'mode': mode, 'linenumbers': linenumbers, 'rows': rows, 'cols': cols, 'hidden': hidden, 'tabsize': tabsize, - 'queued': queued, 'queue_len': queue_len, + 'queue_len': queue_len, } html = render_template("textbox.html", context) try: diff --git a/common/lib/capa/capa/templates/filesubmission.html b/common/lib/capa/capa/templates/filesubmission.html index 09bc287923..d3d57ee318 100644 --- a/common/lib/capa/capa/templates/filesubmission.html +++ b/common/lib/capa/capa/templates/filesubmission.html @@ -6,11 +6,9 @@ % elif state == 'incorrect': - % elif state == 'incomplete': - - % endif - % if queued: - ${queue_len} + % elif state == 'queued': + + % endif (${state})
diff --git a/common/lib/capa/capa/templates/textbox.html b/common/lib/capa/capa/templates/textbox.html index f31b98b580..647f4fe4e8 100644 --- a/common/lib/capa/capa/templates/textbox.html +++ b/common/lib/capa/capa/templates/textbox.html @@ -13,14 +13,12 @@ % elif state == 'incorrect': - % elif state == 'incomplete': - + % elif state == 'queued': + + % endif % if hidden: -
- % endif - % if queued: - ${queue_len} +
% endif
(${state})