start testing

This commit is contained in:
Ross
2022-05-21 11:20:21 +01:00
parent 0ca980ccb6
commit 160bb13b64
18 changed files with 203 additions and 61 deletions
+18 -4
View File
@@ -15,7 +15,7 @@ from sortedm2m.fields import SortedManyToManyField
import string
from generic.models import CidUser, Examination, ExamBase, QuestionNote
from generic.models import CidUser, CidUserGroup, Examination, ExamBase, QuestionNote, UserUserGroup
from collections import defaultdict
from helpers.images import image_as_base64
@@ -391,6 +391,20 @@ class Exam(ExamBase):
settings.AUTH_USER_MODEL, blank=True, related_name="user_anatomy_exams"
)
cid_user_groups = models.ManyToManyField(
CidUserGroup,
blank=True,
help_text="These groups define which candidates are able to be added to the exams/collection.",
related_name="anatomy_cid_user_groups"
)
user_user_groups = models.ManyToManyField(
UserUserGroup,
blank=True,
help_text="These groups define which candidates are able to be added to the exams/collection.",
related_name="anatomy_user_user_groups"
)
def get_exam_json(self, based=True):
questions = self.exam_questions.all()
@@ -452,9 +466,9 @@ class CidUserAnswer(models.Model):
help_text="Candidate ID (limitied by BigIntegerField size)",
)
#user = models.ForeignKey(
# settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True#, related_name="user_anatomy_user_answers"
#)
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True, related_name="user_anatomy_user_answers"
)
# Each user answer is associated with a particular exam
exam = models.ForeignKey(