This commit is contained in:
Ross
2021-08-20 21:38:01 +01:00
parent 271fcf088f
commit 7d4a5025da
+24
View File
@@ -10,10 +10,34 @@ from django.forms import ModelForm
from reversion.admin import VersionAdmin
from django.forms.widgets import RadioSelect
from tinymce.widgets import TinyMCE
class ExamInline(admin.TabularInline):
model = Question.exams.through
extra = 1
class QuestionAdminForm(ModelForm):
class Meta:
model = Question
widgets = {
# "normal": RadioSelect(
# choices=[(True, 'Yes'),
# (False, 'No')])
"stem" : TinyMCE(attrs={'cols': 80, 'rows': 30}),
"feedback" : TinyMCE(attrs={'cols': 80, 'rows': 30}),
"a_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"a_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
"e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}),
}
class QuestionAdmin(VersionAdmin):
#form = RapidAdminForm