generalise a QuestionBase

This commit is contained in:
Ross
2023-06-05 09:10:54 +01:00
parent ac558b9ea2
commit e0723d4d3a
8 changed files with 177 additions and 141 deletions
+2 -9
View File
@@ -16,7 +16,7 @@ from sortedm2m.fields import SortedManyToManyField
import string
from generic.models import CidUser, CidUserGroup, ExamUserStatus, Examination, ExamBase, QuestionNote, UserAnswerBase, UserUserGroup
from generic.models import CidUser, CidUserGroup, ExamUserStatus, Examination, ExamBase, QuestionBase, QuestionNote, UserAnswerBase, UserUserGroup
from collections import defaultdict
from helpers.images import image_as_base64
@@ -72,7 +72,7 @@ class QuestionType(models.Model):
@reversion.register
class AnatomyQuestion(models.Model):
class AnatomyQuestion(QuestionBase):
question_type = models.ForeignKey(
QuestionType, on_delete=models.SET_NULL, null=True, default=1
)
@@ -114,11 +114,6 @@ class AnatomyQuestion(models.Model):
structure = models.ForeignKey(
Structure, on_delete=models.SET_NULL, null=True, blank=True
)
created_date = models.DateTimeField(default=timezone.now)
open_access = models.BooleanField(
help_text="If a question should be freely available to browse", default=True
)
author = models.ManyToManyField(
settings.AUTH_USER_MODEL,
@@ -127,8 +122,6 @@ class AnatomyQuestion(models.Model):
related_name="anatomy_authored_questions",
)
notes = GenericRelation(QuestionNote)
class Meta:
permissions = ()