diff --git a/sbas/forms.py b/sbas/forms.py new file mode 100755 index 00000000..cbccd41a --- /dev/null +++ b/sbas/forms.py @@ -0,0 +1,31 @@ +from django.forms import ( + Form, + ModelForm, + ModelMultipleChoiceField, + ModelChoiceField, + ChoiceField, + CharField, +) +from django.forms import inlineformset_factory + +from rapids.models import ( + Question, + CidUserAnswer, + Exam, +) + +from django.contrib.admin.widgets import FilteredSelectMultiple +from django.forms.widgets import RadioSelect, TextInput, Textarea + + +class CidUserAnswerForm(ModelForm): + class Meta: + model = CidUserAnswer + fields = ["answer"] + + +# This should be made generic? +class ExamForm(ModelForm): + class Meta: + model = Exam + fields = ["name", "time_limit", "exam_mode", "active"] \ No newline at end of file diff --git a/sbas/templates/sbas/exam_take.html b/sbas/templates/sbas/exam_take.html index 61de3e44..cd390131 100755 --- a/sbas/templates/sbas/exam_take.html +++ b/sbas/templates/sbas/exam_take.html @@ -4,6 +4,11 @@ CID: {{cid}}
{{question.stem}}