Keep queueuing time
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user