allow completion of sbas / physics exams

This commit is contained in:
Ross
2024-12-30 11:12:36 +00:00
parent 13713d870f
commit 7493d55bc2
17 changed files with 362 additions and 240 deletions
+10 -1
View File
@@ -1518,6 +1518,12 @@ class CidUserExam(models.Model):
else:
return "CID" + str(self.cid_user.cid)
def complete_exam(self):
# TODO add examuserstatus?
self.end_time = timezone.now()
self.completed = True
self.save()
CID_GROUP_EXAMS = (
("SBAs", "sba_cid_user_groups"),
@@ -1729,7 +1735,10 @@ class ExamCollection(models.Model, AuthorMixin):
)
def __str__(self):
return f"{self.name} [{self.date}]"
if self.date is not None and self.date is not "":
return f"{self.name} [{self.date}]"
else:
return f"{self.name}"
def get_absolute_url(self):
return reverse("generic:examcollection_detail", kwargs={"pk": self.pk})