Commit 673cc2bb by kimth

Keep queueuing time

parent 77f928d1
......@@ -73,6 +73,9 @@ class CorrectMap(object):
def is_right_queuekey(self, answer_id, test_key):
return self.is_queued(answer_id) and self.cmap[answer_id]['queuestate'][0] == test_key
def get_queuetime_str(self, answer_id):
return self.cmap[answer_id]['queuestate'][1] if self.is_queued(answer_id) else None
def get_npoints(self, answer_id):
npoints = self.get_property(answer_id, 'npoints')
if npoints is not None:
......
......@@ -1149,7 +1149,10 @@ class CodeResponse(LoncapaResponse):
(error, msg) = qinterface.send_to_queue(header=xheader,
body=json.dumps(contents))
queuestate = (queuekey,'')
# State associated with the queueing request
qtime = datetime.strftime(datetime.now(), '%Y%m%d%H%M%S')
queuestate = (queuekey, qtime)
cmap = CorrectMap()
if error:
cmap.set(self.answer_id, queuestate=None,
......
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