From da0cbf555befa6b8d703e22a1231b41fb05293a4 Mon Sep 17 00:00:00 2001 From: smshine Date: Sat, 7 Feb 2026 11:06:44 +0800 Subject: [PATCH] fixed style --- styles.css | 8 ++++++++ submit_form.php | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/styles.css b/styles.css index 77d2e55..c91aee8 100644 --- a/styles.css +++ b/styles.css @@ -30,6 +30,14 @@ text-align: left; } +.path-mod-programming .programming-code-input { + width: 100%; + max-width: 100%; + min-height: 420px; + box-sizing: border-box; + font-family: "Consolas","Courier New",Courier,monospace; +} + .path-mod-programming .buttons { margin: 1em; text-align: center; diff --git a/submit_form.php b/submit_form.php index 487916b..2ba4881 100644 --- a/submit_form.php +++ b/submit_form.php @@ -10,7 +10,11 @@ class submit_form extends moodleform { //------------------------------------------------------------------------------- $mform->addElement('hidden', 'id', $cm->id); $mform->setType('id', PARAM_INT); - $mform->addElement('textarea', 'code', get_string('programcode', 'programming'), 'rows="20" cols="90"'); + $mform->addElement('textarea', 'code', get_string('programcode', 'programming'), array( + 'rows' => 24, + 'cols' => 120, + 'class' => 'programming-code-input' + )); $attributes = 'onchange ="change()"'; $mform->addElement('select', 'language', get_string('programminglanguage', 'programming'), programming_get_language_options($programming),$attributes);