.
This commit is contained in:
@@ -34,6 +34,8 @@ from longs.models import Long as LongQuestion
|
||||
from longs.models import Exam as LongExam
|
||||
from anatomy.models import AnatomyQuestion as AnatomyQuestion
|
||||
from anatomy.models import Exam as AnatomyExam
|
||||
from sbas.models import Question as SbasQuestion
|
||||
from sbas.models import Exam as SbasExam
|
||||
|
||||
from django.db.models import Case, When
|
||||
from django.conf import settings
|
||||
@@ -53,6 +55,9 @@ def get_question_and_content_type(question_type):
|
||||
elif question_type == "long":
|
||||
question = LongQuestion
|
||||
content_type = ContentType.objects.get(model="long")
|
||||
elif question_type == "sba":
|
||||
question = SbasQuestion
|
||||
content_type = ContentType.objects.get(model="sba")
|
||||
else:
|
||||
raise PermissionError()
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.6 on 2021-09-13 07:48
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('longs', '0051_exam_double_mark'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='exam',
|
||||
name='double_mark',
|
||||
field=models.BooleanField(default=True, help_text='Defines if an exam is expected to be double marked'),
|
||||
),
|
||||
]
|
||||
+5
-1
@@ -11,10 +11,12 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from sortedm2m.fields import SortedManyToManyField
|
||||
|
||||
from generic.models import ExamBase
|
||||
from generic.models import ExamBase, QuestionNote
|
||||
|
||||
import reversion
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
|
||||
class Category(models.Model):
|
||||
category = models.CharField(max_length=200)
|
||||
|
||||
@@ -99,6 +101,8 @@ class Question(models.Model):
|
||||
Category, on_delete=models.SET_NULL, null=True, blank=True
|
||||
)
|
||||
|
||||
notes = GenericRelation(QuestionNote)
|
||||
|
||||
def __str__(self):
|
||||
return self.stem
|
||||
|
||||
|
||||
Reference in New Issue
Block a user