From 2a94e40a1e7c711c89ae329606910cdf3c5f7814 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 20 Oct 2025 12:58:17 +0100 Subject: [PATCH] Update QuestionForm to increase TinyMCE editor height for better visibility and modify import_llm_confirm to set question title directly from payload --- sbas/forms.py | 20 ++++++++++---------- sbas/views.py | 4 +--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/sbas/forms.py b/sbas/forms.py index 1101a18a..ff032da6 100755 --- a/sbas/forms.py +++ b/sbas/forms.py @@ -156,16 +156,16 @@ class QuestionForm(ModelForm): # (False, 'No')]) "stem" : 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_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 5}, mce_attrs={'height': 140}), - "b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "d_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "e_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "b_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "c_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 140}), - "e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, 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': 200}), + "b_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "c_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "d_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "e_answer" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "b_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "c_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "d_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), + "e_feedback" : TinyMCE(attrs={'cols': 80, 'rows': 4}, mce_attrs={'height': 200}), "structure": autocomplete.ModelSelect2Multiple( url="atlas:structure-autocomplete" ), diff --git a/sbas/views.py b/sbas/views.py index 220a4891..cafd2343 100644 --- a/sbas/views.py +++ b/sbas/views.py @@ -883,9 +883,7 @@ def import_llm_confirm(request): with transaction.atomic(): q = Question() q.stem = payload.get("stem", "").strip() - title = payload.get("title") - if title: - q.stem = f"{title}\n" + q.stem + q.title = payload.get("title") q.a_answer = payload.get("a_answer", "").strip() q.a_feedback = payload.get("a_feedback", "") q.b_answer = payload.get("b_answer", "").strip()