""" This module holds the forms of the ``evaluations`` app. """

from django import forms

from .models import Criterion, Evaluation, Exercise


class EvaluationForm(forms.ModelForm):
    """This form allows to create and edit evaluations."""

    class Meta:
        model = Evaluation
        fields = (
            'name',
            'evaluation_type',
            'hidden',
        )


class ExerciseForm(forms.ModelForm):
    """This form allows to create and edit exercises."""

    class Meta:
        model = Exercise
        fields = (
            'name',
            'description',
            'start_range',
            'end_range',
            'step',
            'preview',
        )


class CriterionForm(forms.ModelForm):
    """This form allows to create and edit criteria."""

    class Meta:
        model = Criterion
        fields = (
            'criterion_type',
            'description',
        )
