mq-quiz / src /quizzes /admin.py
Teddy Xinyuan Chen
2024-10-08T20-08-36Z
977aa4a
from django.contrib import admin
from .models import FreeTextAnswer, LLMGradedAnswer, MultipleChoiceAnswer, Question, Quiz
admin.site.register(Quiz)
class FreeTextAnswerInline(admin.StackedInline):
model = FreeTextAnswer
class MultipleChoiceAnswerInline(admin.StackedInline):
model = MultipleChoiceAnswer
class LLMGradedAnswerInline(admin.StackedInline):
model = LLMGradedAnswer
class QuestionAdmin(admin.ModelAdmin):
inlines = [FreeTextAnswerInline, MultipleChoiceAnswerInline, LLMGradedAnswerInline]
admin.site.register(Question, QuestionAdmin)