This commit is contained in:
Ross
2021-03-09 15:28:54 +00:00
parent 7846eff6a3
commit d5637a1402
7 changed files with 84 additions and 3 deletions
@@ -0,0 +1,18 @@
# Generated by Django 3.1.3 on 2021-03-09 15:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('anatomy', '0034_auto_20210215_1200'),
]
operations = [
migrations.AddField(
model_name='exam',
name='json_creation_time',
field=models.DateTimeField(blank=True, default=None, null=True),
),
]
+1 -1
View File
@@ -64,7 +64,7 @@ class ExamBase(models.Model):
help_text="If the json cache needs updating", default=False
)
json_creation_time = models.DateTimeField(blank=True)
json_creation_time = models.DateTimeField(blank=True, default=None, null=True)
#time_limit = models.IntegerField(
# help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)",
+5 -1
View File
@@ -319,13 +319,17 @@ class ExamViews(View, LoginRequiredMixin):
for exam in exams:
if exam.active:
if exam.json_creation_time:
creation_time = exam.json_creation_time.isoformat()
else:
creation_time = "None"
active_exams["exams"].append(
{
"name": exam.get_exam_name(),
"url": request.build_absolute_uri(exam.get_json_url()),
"type": self.question_type,
"eid": "{}/{}".format(self.question_type, exam.pk),
"json_creation_time": exam.json_creation_time.isoformat()
"json_creation_time": creation_time
}
)
@@ -0,0 +1,23 @@
# Generated by Django 3.1.3 on 2021-03-09 15:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('longs', '0030_long_recreate_json'),
]
operations = [
migrations.AddField(
model_name='exam',
name='json_creation_time',
field=models.DateTimeField(blank=True, default=None, null=True),
),
migrations.AddField(
model_name='long',
name='json_creation_time',
field=models.DateTimeField(blank=True, default=None, null=True),
),
]
+1 -1
View File
@@ -120,7 +120,7 @@ class Long(models.Model):
help_text="If the json cache needs updating", default=False
)
json_creation_time = models.DateTimeField(blank=True)
json_creation_time = models.DateTimeField(blank=True, default=None, null=True)
#question_file = models.FileField(upload_to=question_file_directory_path, blank=True, null=True)
@@ -0,0 +1,18 @@
# Generated by Django 3.1.3 on 2021-03-09 15:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('physics', '0003_auto_20201228_2235'),
]
operations = [
migrations.AddField(
model_name='exam',
name='json_creation_time',
field=models.DateTimeField(blank=True, default=None, null=True),
),
]
@@ -0,0 +1,18 @@
# Generated by Django 3.1.3 on 2021-03-09 15:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rapids', '0019_auto_20210215_1203'),
]
operations = [
migrations.AddField(
model_name='exam',
name='json_creation_time',
field=models.DateTimeField(blank=True, default=None, null=True),
),
]