add exam collections
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.1.4 on 2024-01-29 09:57
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('generic', '0011_examcollection'),
|
||||
('rapids', '0003_exam_stats_graph'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='exam',
|
||||
name='exam_collection',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rapids_exams', to='generic.examcollection'),
|
||||
),
|
||||
]
|
||||
@@ -28,6 +28,7 @@ from django.contrib.contenttypes.fields import GenericRelation
|
||||
from generic.models import (
|
||||
CidUser,
|
||||
CidUserGroup,
|
||||
ExamCollection,
|
||||
ExamUserStatus,
|
||||
QuestionBase,
|
||||
Site,
|
||||
@@ -648,6 +649,8 @@ class Exam(ExamBase):
|
||||
|
||||
exam_user_status = GenericRelation(ExamUserStatus)
|
||||
|
||||
exam_collection = models.ForeignKey(ExamCollection, blank=True, null=True, on_delete=models.SET_NULL, related_name="rapids_exams")
|
||||
|
||||
def get_normal_abnormal_breakdown(self):
|
||||
# Inefficient but more extendible
|
||||
questions = self.exam_questions.all()
|
||||
|
||||
Reference in New Issue
Block a user