.
This commit is contained in:
+4
-4
@@ -126,7 +126,7 @@ class Long(models.Model):
|
||||
|
||||
json_creation_time = models.DateTimeField(blank=True, default=None, null=True)
|
||||
|
||||
json_creation_id = models.IntegerField(default=1, help_text="Auto incrementing json creation number")
|
||||
question_json_id = models.IntegerField(default=1, help_text="Auto incrementing json creation number")
|
||||
|
||||
#question_file = models.FileField(upload_to=question_file_directory_path, blank=True, null=True)
|
||||
|
||||
@@ -214,7 +214,7 @@ class Long(models.Model):
|
||||
url= "{0}longs/questions/{1}.json".format(settings.MEDIA_URL, question_id)
|
||||
|
||||
timestamp = datetime.datetime.now()
|
||||
q.json_creation_id += 1
|
||||
q.question_json_id += 1
|
||||
|
||||
with open(path, "w+") as f:
|
||||
|
||||
@@ -224,7 +224,7 @@ class Long(models.Model):
|
||||
"type": "long",
|
||||
"generated": "{}",
|
||||
"creation_id": "{}",
|
||||
""".format(q.history, timestamp.isoformat(), q.json_creation_id)
|
||||
""".format(q.history, timestamp.isoformat(), q.question_json_id)
|
||||
)
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ class Exam(ExamBase):
|
||||
# If it is a new question we need to for a question json refresh
|
||||
if q.json_creation_time is None:
|
||||
q.get_json(q.pk)
|
||||
exam_questions[q.id] = q.json_creation_id
|
||||
exam_questions[q.id] = q.question_json_id
|
||||
|
||||
else:
|
||||
# TODO: combine with question_json
|
||||
|
||||
Reference in New Issue
Block a user