add exam collections

This commit is contained in:
Ross
2024-01-29 09:58:18 +00:00
parent e89cf704ed
commit 04dcb74e67
15 changed files with 186 additions and 7 deletions
@@ -0,0 +1,20 @@
# Generated by Django 4.1.4 on 2024-01-29 09:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('generic', '0011_examcollection'),
('longs', '0014_exam_stats_graph'),
]
operations = [
migrations.AddField(
model_name='exam',
name='exam_collection',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='longs_exams', to='generic.examcollection'),
),
]
+3
View File
@@ -28,6 +28,7 @@ from helpers.images import image_as_base64, pretty_print_dicom
from generic.models import (
CidUser,
CidUserGroup,
ExamCollection,
ExamUserStatus,
Examination,
ExamBase,
@@ -465,6 +466,8 @@ class Exam(ExamBase):
exam_user_status = GenericRelation(ExamUserStatus)
exam_collection = models.ForeignKey(ExamCollection, blank=True, null=True, on_delete=models.SET_NULL, related_name="longs_exams")
def get_exam_question_json(self, question_id):
q = get_object_or_404(Long, pk=question_id)