mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 04:44:19 +01:00
Add basic quiz functionality
This commit is contained in:
26
tvdt/quiz/models/correction.py
Normal file
26
tvdt/quiz/models/correction.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_stubs_ext.db.models import TypedModelMeta
|
||||
|
||||
from .candidate import Candidate
|
||||
from .quiz import Quiz
|
||||
|
||||
|
||||
class Correction(models.Model):
|
||||
candidate = models.ForeignKey(
|
||||
"Candidate",
|
||||
on_delete=models.CASCADE,
|
||||
related_name="corrections_used",
|
||||
verbose_name=_("candidate"),
|
||||
)
|
||||
quiz = models.ForeignKey(
|
||||
"Quiz",
|
||||
on_delete=models.CASCADE,
|
||||
related_name="corrections_used",
|
||||
verbose_name=_("quiz"),
|
||||
)
|
||||
|
||||
class Meta(TypedModelMeta):
|
||||
unique_together = ("candidate", "quiz")
|
||||
verbose_name = _("correction")
|
||||
verbose_name_plural = _("corrections")
|
||||
Reference in New Issue
Block a user