add simple survey support

This commit is contained in:
Ross
2026-06-29 09:04:28 +01:00
parent d07d88bdbf
commit 79ba4db4bf
33 changed files with 1687 additions and 2 deletions
+5 -1
View File
@@ -146,6 +146,8 @@ class ExamFormMixin:
"active",
"publish_results",
"archive",
"pre_survey",
"post_survey",
Accordion(
AccordionGroup("Date restrictions",
"restrict_to_dates",
@@ -214,7 +216,9 @@ class ExamFormMixin:
"active",
"publish_results",
"archive",
"results_supervisor_visible"
"results_supervisor_visible",
"pre_survey",
"post_survey",
# "cid_user_groups",
# "user_user_groups",
# "author",
+17
View File
@@ -716,6 +716,23 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
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.")
pre_survey = models.ForeignKey(
"survey.Survey",
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="%(app_label)s_%(class)s_pre_surveys",
help_text="Survey to be filled out BEFORE taking this collection/exam."
)
post_survey = models.ForeignKey(
"survey.Survey",
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="%(app_label)s_%(class)s_post_surveys",
help_text="Survey to be filled out AFTER completing this collection/exam."
)
class Meta:
abstract = True