Add LLM question import functionality and enhance question model with new fields

This commit is contained in:
Ross
2025-10-20 10:43:12 +01:00
parent 4986c2faa9
commit 93f0bb8927
10 changed files with 565 additions and 3 deletions
+9
View File
@@ -15,6 +15,8 @@ import reversion
from django.contrib.contenttypes.fields import GenericRelation
from atlas.models import Finding, Structure, Condition, Subspecialty, Presentation
class Category(models.Model):
category = models.CharField(max_length=200)
@@ -24,6 +26,7 @@ class Category(models.Model):
class Question(QuestionBase):
title = models.CharField(max_length=200, help_text="Short title for question", blank=True, null=True)
stem = models.TextField(
blank=False,
help_text="Stem of the question",
@@ -91,6 +94,12 @@ class Question(QuestionBase):
Category, on_delete=models.SET_NULL, null=True, blank=True
)
finding = models.ManyToManyField(Finding, blank=True, related_name="sbas_questions")
structure = models.ManyToManyField(Structure, blank=True, related_name="sbas_questions")
condition = models.ManyToManyField(Condition, blank=True, related_name="sbas_questions")
presentation = models.ManyToManyField(Presentation, blank=True, related_name="sbas_questions")
subspecialty = models.ManyToManyField(Subspecialty, blank=True, related_name="sbas_questions")
#notes = GenericRelation(QuestionNote)
def __str__(self):