from django.contrib import admin
from .models import Level, Question, Option, Score

class OptionInline(admin.TabularInline):
    model = Option
    extra = 4

class QuestionAdmin(admin.ModelAdmin):
    inlines = [OptionInline]
    list_display = ('text', 'level', 'points', 'time_limit')
    list_filter = ('level',)

class LevelAdmin(admin.ModelAdmin):
    list_display = ('title', 'order')

class ScoreAdmin(admin.ModelAdmin):
    list_display = ('player_name', 'score', 'level', 'date_played')
    list_filter = ('level', 'date_played')

admin.site.register(Level, LevelAdmin)
admin.site.register(Question, QuestionAdmin)
admin.site.register(Score, ScoreAdmin)