Commit b5d377ad by Calen Pennington

Merge pull request #388 from MITx/kimth/lms-coderesponse

Spinner on waiting for queue
parents c8675606 125bbbf9
...@@ -309,15 +309,14 @@ def filesubmission(element, value, status, render_template, msg=''): ...@@ -309,15 +309,14 @@ def filesubmission(element, value, status, render_template, msg=''):
eid = element.get('id') eid = element.get('id')
# Check if problem has been queued # Check if problem has been queued
queued = ''
queue_len = 0 queue_len = 0
if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue
queued = 'true' status = 'queued'
queue_len = msg queue_len = msg
msg = 'Submitted to grader. (Queue length: %s)' % queue_len msg = 'Submitted to grader. (Queue length: %s)' % queue_len
context = { 'id': eid, 'state': status, 'msg': msg, 'value': value, 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) html = render_template("filesubmission.html", context)
return etree.XML(html) return etree.XML(html)
...@@ -342,10 +341,9 @@ def textbox(element, value, status, render_template, msg=''): ...@@ -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 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 # Check if problem has been queued
queued = ''
queue_len = 0 queue_len = 0
if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue if status == 'incomplete': # Flag indicating that the problem has been queued, 'msg' is length of queue
queued = 'true' status = 'queued'
queue_len = msg queue_len = msg
msg = 'Submitted to grader. (Queue length: %s)' % queue_len msg = 'Submitted to grader. (Queue length: %s)' % queue_len
...@@ -359,7 +357,7 @@ def textbox(element, value, status, render_template, msg=''): ...@@ -359,7 +357,7 @@ def textbox(element, value, status, render_template, msg=''):
'mode': mode, 'linenumbers': linenumbers, 'mode': mode, 'linenumbers': linenumbers,
'rows': rows, 'cols': cols, 'rows': rows, 'cols': cols,
'hidden': hidden, 'tabsize': tabsize, 'hidden': hidden, 'tabsize': tabsize,
'queued': queued, 'queue_len': queue_len, 'queue_len': queue_len,
} }
html = render_template("textbox.html", context) html = render_template("textbox.html", context)
try: try:
......
...@@ -6,11 +6,9 @@ ...@@ -6,11 +6,9 @@
<span class="correct" id="status_${id}"></span> <span class="correct" id="status_${id}"></span>
% elif state == 'incorrect': % elif state == 'incorrect':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
% elif state == 'incomplete': % elif state == 'queued':
<span class="incorrect" id="status_${id}"></span> <span class="processing" id="status_${id}"></span>
% endif <span style="display:none;" class="xqueue" id="${id}" >${queue_len}</span>
% if queued:
<span class="xqueue" id="${id}" >${queue_len}</span>
% endif % endif
<span class="debug">(${state})</span> <span class="debug">(${state})</span>
<br/> <br/>
......
...@@ -13,14 +13,12 @@ ...@@ -13,14 +13,12 @@
<span class="correct" id="status_${id}"></span> <span class="correct" id="status_${id}"></span>
% elif state == 'incorrect': % elif state == 'incorrect':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
% elif state == 'incomplete': % elif state == 'queued':
<span class="incorrect" id="status_${id}"></span> <span class="processing" id="status_${id}"></span>
<span style="display:none;" class="xqueue" id="${id}" >${queue_len}</span>
% endif % endif
% if hidden: % if hidden:
<div style="display:none;" name="${hidden}" inputid="input_${id}" /> <div style="display:none;" name="${hidden}" inputid="input_${id}" />
% endif
% if queued:
<span class="xqueue" id="${id}" >${queue_len}</span>
% endif % endif
<br/> <br/>
<span class="debug">(${state})</span> <span class="debug">(${state})</span>
......
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