improve case user answer management (and fix small bug)

This commit is contained in:
Ross
2024-11-18 10:44:27 +00:00
parent 9c69792e87
commit 00323cc6bd
7 changed files with 125 additions and 30 deletions
+4 -2
View File
@@ -613,6 +613,8 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
default=False,
)
exam_open_access = models.BooleanField(default=False, help_text="Set to true if you want any registered user to be able to take the exam.")
class Meta:
abstract = True
@@ -718,6 +720,8 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
return True
if cid is None and user_id is None:
if user.is_anonymous:
return False
if user is not None:
user_id = user.id
else:
@@ -869,8 +873,6 @@ class ExamBase(ExamOrCollectionGenericBase):
default=False,
)
exam_open_access = models.BooleanField(default=False, help_text="Set to true if you want any registered user to be able to take the exam.")
# randomise_question_order = models.BooleanField(
# help_text="If an exam should randomise the order of questions in RTS.",
# )