mark submissions with opened links
[edumed.git] / wtem / models.py
index 390687f..ccbf67f 100644 (file)
@@ -79,6 +79,7 @@ class Submission(models.Model):
     email = models.EmailField(max_length=100, unique=True)
     answers = models.CharField(max_length=65536, null=True, blank=True)
     key_sent = models.BooleanField(default=False)
+    opened_link = models.BooleanField(default=False)
     marks = JSONField(default={})
     examiners = models.ManyToManyField(User, null=True, blank=True)
     end_time = models.CharField(max_length=5, null=True, blank=True)
@@ -278,6 +279,9 @@ class Confirmation(models.Model):
     def readable_contact(self):
         return '%s <%s>' % (self.contact.body.get('przewodniczacy'), self.contact.contact)
 
+    def school_phone(self):
+        return '%s, tel. %s' % (self.contact.body.get('school'), self.contact.body.get('school_phone'))
+
     def age(self):
         return timezone.now() - self.contact.created_at