allow completion of sbas / physics exams
This commit is contained in:
+10
-1
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user