zwischenstand

This commit is contained in:
nik8
2025-04-09 14:22:46 +02:00
parent 145d339ae1
commit f405016f96
6 changed files with 69 additions and 3 deletions

View File

@@ -19,6 +19,9 @@ class QivipQuiz(models.Model):
"nicht gesetzt":"nicht gesetzt",
}
def validate_description(value):
if value.strip() == "In dem Quiz geht es um ...":
@@ -48,12 +51,22 @@ class QivipQuiz(models.Model):
# Create your models here.
class QivipQuestion(models.Model):
TIME_VALUES = {
"10": 10,
"15": 15,
"30": 30,
"60": 60,
"90": 90,
"120": 120,
"180": 180,
}
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
quiz_id = models.ForeignKey(QivipQuiz, on_delete=models.CASCADE, related_name='questions')
creation_date = models.DateTimeField(auto_now_add=True)
update_date = models.DateTimeField(auto_now=True)
data = models.TextField()
time_per_question= models.CharField(max_length=3, choices=list(TIME_VALUES.items()), default=30, help_text="Zeit pro Frage in Sekunden")
def __str__(self):
return self.data[:50]