improve case user answer management (and fix small bug)
This commit is contained in:
+4
-2
@@ -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.",
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user