Update QuestionForm to increase TinyMCE editor height for better visibility and modify import_llm_confirm to set question title directly from payload

This commit is contained in:
Ross
2025-10-20 12:58:17 +01:00
parent 4d305e1fa2
commit 2a94e40a1e
2 changed files with 11 additions and 13 deletions
+10 -10
View File
@@ -156,16 +156,16 @@ class QuestionForm(ModelForm):
# (False, 'No')]) # (False, 'No')])
"stem" : TinyMCE(attrs={'cols': 80, 'rows': 30}), "stem" : TinyMCE(attrs={'cols': 80, 'rows': 30}),
"feedback" : TinyMCE(attrs={'cols': 80, 'rows': 30}), "feedback" : TinyMCE(attrs={'cols': 80, 'rows': 30}),
"a_answer" : TinyMCE(attrs={'cols': 80, 'rows': 5}, mce_attrs={'height': 140}), "a_answer" : TinyMCE(attrs={'cols': 80, 'rows': 5}, mce_attrs={'height': 200}),
"a_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 5}, mce_attrs={'height': 140}), "a_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 5}, mce_attrs={'height': 200}),
"b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"d_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "d_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"e_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "e_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"b_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "b_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"c_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "c_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), "e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}),
"structure": autocomplete.ModelSelect2Multiple( "structure": autocomplete.ModelSelect2Multiple(
url="atlas:structure-autocomplete" url="atlas:structure-autocomplete"
), ),
+1 -3
View File
@@ -883,9 +883,7 @@ def import_llm_confirm(request):
with transaction.atomic(): with transaction.atomic():
q = Question() q = Question()
q.stem = payload.get("stem", "").strip() q.stem = payload.get("stem", "").strip()
title = payload.get("title") q.title = payload.get("title")
if title:
q.stem = f"<strong>{title}</strong>\n" + q.stem
q.a_answer = payload.get("a_answer", "").strip() q.a_answer = payload.get("a_answer", "").strip()
q.a_feedback = payload.get("a_feedback", "") q.a_feedback = payload.get("a_feedback", "")
q.b_answer = payload.get("b_answer", "").strip() q.b_answer = payload.get("b_answer", "").strip()