All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
23 lines
806 B
Python
23 lines
806 B
Python
from django.db import models
|
|
from .quiz_user_model import QuizUser
|
|
from .course_model import Course
|
|
from .exam_model import Exam
|
|
from .tag_model import Tag
|
|
|
|
|
|
class QuizSession(models.Model):
|
|
user = models.ForeignKey(QuizUser, on_delete=models.CASCADE, related_name='quiz_sessions')
|
|
course = models.ForeignKey(Course, on_delete=models.SET_NULL, null=True, blank=True)
|
|
exams = models.ManyToManyField(Exam, blank=True)
|
|
tags = models.ManyToManyField(Tag, blank=True)
|
|
question_types = models.JSONField(default=list, blank=True) # Store as list of strings
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
is_active = models.BooleanField(default=True)
|
|
|
|
class Meta:
|
|
ordering = ['-created_at']
|
|
|
|
def __str__(self):
|
|
return f"Session {self.id} for {self.user}"
|
|
|