.
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ class ExamBase(models.Model):
|
||||
)
|
||||
|
||||
json_creation_time = models.DateTimeField(blank=True, default=None, null=True)
|
||||
json_creation_id = models.IntegerField(default=1, help_text="auto incrementing field when json recreated")
|
||||
exam_json_id = models.IntegerField(default=1, help_text="auto incrementing field when json recreated")
|
||||
|
||||
#time_limit = models.IntegerField(
|
||||
# help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)",
|
||||
|
||||
+4
-4
@@ -401,7 +401,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
"type": self.question_type,
|
||||
"eid": "{}/{}".format(self.question_type, exam.pk),
|
||||
"json_creation_time": creation_time,
|
||||
"json_creation_id": exam.creation_id
|
||||
"exam_json_id": exam.exam_json_id
|
||||
}
|
||||
|
||||
if self.question_type == "long":
|
||||
@@ -410,7 +410,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
# Generate json if needed
|
||||
if question.json_creation_time is None:
|
||||
question.get_json(question.pk)
|
||||
h[question.pk] = question.json_creation_id
|
||||
h[question.pk] = question.question_json_id
|
||||
obj["multi_question_json"] = h
|
||||
active_exams["exams"].append( obj )
|
||||
|
||||
@@ -477,12 +477,12 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
|
||||
time = datetime.now()
|
||||
|
||||
exam.json_creation_id += 1
|
||||
exam.exam_json_id += 1
|
||||
|
||||
with open(path, "w+") as f:
|
||||
exam_json = exam.get_exam_json()
|
||||
exam_json["generated"] = time.isoformat()
|
||||
exam_json["creation_id"] = exam.json_creation_id
|
||||
exam_json["exam_json_id"] = exam.exam_json_id
|
||||
f.write(json.dumps(exam_json))
|
||||
|
||||
exam.recreate_json = False
|
||||
|
||||
Reference in New Issue
Block a user