from django.contrib import admin
from .models import (
    AnatomyQuestion,
    #Examination,
    QuestionType,
    Answer,
    UserAnswer,
    Exam,
    #Modality,
    Region,
    BodyPart,
)

from generic.models import Examination

from reversion.admin import VersionAdmin

# Register your models here.
class AnatomyAnswersInline(admin.TabularInline):
    model = Answer
    extra = 1


#class HalfMarkAnatomyAnswersInline(admin.TabularInline):
#    model = HalfMarkAnswers
#    extra = 1
#
#
#class IncorrectAnatomyAnswersInline(admin.TabularInline):
#    model = IncorrectAnswers
#    extra = 1


class ExamInline(admin.TabularInline):
    model = AnatomyQuestion.exams.through
    extra = 1


class AnatomyAdmin(VersionAdmin):
    inlines = [
        AnatomyAnswersInline,
        #HalfMarkAnatomyAnswersInline,
        #IncorrectAnatomyAnswersInline,
        ExamInline,
    ]
    view_on_site = True

    exclude = [ "image_annotations" ]

class ExamAdmin(VersionAdmin, admin.ModelAdmin):
    save_as = True

admin.site.register(AnatomyQuestion, AnatomyAdmin)
#admin.site.register(Examination)
admin.site.register(QuestionType)
admin.site.register(UserAnswer)
admin.site.register(Exam, ExamAdmin)
admin.site.register(Region)
admin.site.register(BodyPart)

