from anatomy.models import UserAnswer
from physics.models import Category, Question, Exam, UserAnswer
from generic.models import CidUser
from django.contrib import admin

# Register your models here.

from reversion.admin import VersionAdmin

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


class QuestionAdmin(VersionAdmin):
    inlines = [
        #HalfMarkAnatomyAnswersInline,
        #IncorrectAnatomyAnswersInline,
        ExamInline,
    ]
    #fields = ("stem",
    #("a", "a_answer"),
    #("b", "b_answer"),
    #)

class CidUserInline(admin.TabularInline):
    model = Exam.valid_cid_users.through
    extra = 1

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

    inlines = [
        CidUserInline
    ]

admin.site.register(Category)
admin.site.register(Question, QuestionAdmin)
admin.site.register(Exam, ExamAdmin)
admin.site.register(UserAnswer)

