.
This commit is contained in:
+4
-2
@@ -175,6 +175,8 @@ class Long(models.Model):
|
|||||||
#exam_order.append(q.id)
|
#exam_order.append(q.id)
|
||||||
path= "{0}longs/questions/{1}.json".format(settings.MEDIA_ROOT, question_id)
|
path= "{0}longs/questions/{1}.json".format(settings.MEDIA_ROOT, question_id)
|
||||||
url= "{0}longs/questions/{1}.json".format(settings.MEDIA_URL, question_id)
|
url= "{0}longs/questions/{1}.json".format(settings.MEDIA_URL, question_id)
|
||||||
|
|
||||||
|
timestamp = datetime.datetime.now()
|
||||||
with open(path, "w+") as f:
|
with open(path, "w+") as f:
|
||||||
|
|
||||||
# We manually create the json for long questions to reducem memroy usade
|
# We manually create the json for long questions to reducem memroy usade
|
||||||
@@ -182,7 +184,7 @@ class Long(models.Model):
|
|||||||
"title": "{}",
|
"title": "{}",
|
||||||
"type": "long",
|
"type": "long",
|
||||||
"generated": "{}",
|
"generated": "{}",
|
||||||
""".format(q.history, datetime.datetime.now().isoformat())
|
""".format(q.history, timestamp.isoformat())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -211,7 +213,7 @@ class Long(models.Model):
|
|||||||
f.write('"image_titles" : {} }}'.format(json.dumps(image_titles)))
|
f.write('"image_titles" : {} }}'.format(json.dumps(image_titles)))
|
||||||
|
|
||||||
|
|
||||||
self.json_creation_time = datetime.datetime.now()
|
self.json_creation_time = timestamp
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
#exam_question = {
|
#exam_question = {
|
||||||
|
|||||||
Reference in New Issue
Block a user