import logging

from django.contrib import admin

from adminsortable.admin import SortableAdmin

from moocng.peerreview.models import PeerReviewAssignment, EvaluationCriterion

logger = logging.getLogger(__name__)


class PeerReviewAssignmentAdmin(admin.ModelAdmin):

    list_display = ('__unicode__', 'kq', 'minimum_reviewers')
    list_filter = ('kq__unit__course',)
    search_fields = ('kq__unit__title',)


class EvaluationCriterionAdmin(SortableAdmin):

    list_display = ('title', 'assignment')
    list_filter = ('assignment', 'assignment__kq__unit__course',)


admin.site.register(PeerReviewAssignment, PeerReviewAssignmentAdmin)
admin.site.register(EvaluationCriterion, EvaluationCriterionAdmin)
