From b425749fc3277473814f8c522c152e9750773e25 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 16 Oct 2002 05:31:56 +0000 Subject: [PATCH] Teacher can now use the richtext editor to edit the assignment text --- mod/assignment/db/mysql.php | 4 ++++ mod/assignment/db/mysql.sql | 1 + mod/assignment/mod.html | 40 ++++++++++++++++++++++++++++++++++--- mod/assignment/version.php | 2 +- mod/assignment/view.php | 2 +- 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/mod/assignment/db/mysql.php b/mod/assignment/db/mysql.php index 0c12d56212..873d04fb88 100644 --- a/mod/assignment/db/mysql.php +++ b/mod/assignment/db/mysql.php @@ -79,6 +79,10 @@ function assignment_upgrade($oldversion) { } } + if ($oldversion < 2002101600) { + execute_sql(" ALTER TABLE `assignment` ADD `format` TINYINT(2) UNSIGNED DEFAULT '0' NOT NULL AFTER `description` "); + } + return true; } diff --git a/mod/assignment/db/mysql.sql b/mod/assignment/db/mysql.sql index 6f6b8b8e3b..812a92eded 100644 --- a/mod/assignment/db/mysql.sql +++ b/mod/assignment/db/mysql.sql @@ -7,6 +7,7 @@ CREATE TABLE `assignment` ( `course` int(10) unsigned NOT NULL default '0', `name` varchar(255) NOT NULL default '', `description` text NOT NULL, + `format` tinyint(2) unsigned NOT NULL default '0', `type` int(10) unsigned NOT NULL default '1', `maxbytes` int(10) unsigned NOT NULL default '100000', `timedue` int(10) unsigned NOT NULL default '0', diff --git a/mod/assignment/mod.html b/mod/assignment/mod.html index fcab3f18d3..f53f72106e 100644 --- a/mod/assignment/mod.html +++ b/mod/assignment/mod.html @@ -1,15 +1,41 @@ -
+ + + action=""> @@ -57,6 +83,7 @@ ?>

:

- +

:

- + description); + + if ($usehtmleditor) { + helpbutton("richtext", get_string("helprichtext")); + } else { + helpbutton("text", get_string("helptext")); + } + echo "

"; + print_string("formattexttype"); + echo ": "; + if (!$form->format) { + $form->format = $defaultformat; + } + choose_from_menu(format_text_menu(), "format", $form->format, ""); + echo "

"; + ?>
+
@@ -69,3 +96,10 @@ ">
+ + + diff --git a/mod/assignment/version.php b/mod/assignment/version.php index 8571ceb30d..67f92314af 100644 --- a/mod/assignment/version.php +++ b/mod/assignment/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2002082806; +$module->version = 2002101606; $module->cron = 60; ?> diff --git a/mod/assignment/view.php b/mod/assignment/view.php index 32b22cbc53..05e04c2a5d 100644 --- a/mod/assignment/view.php +++ b/mod/assignment/view.php @@ -66,7 +66,7 @@ echo "".get_string("maximumgrade").": $assignment->grade
"; print_simple_box_end(); echo "
"; - echo text_to_html($assignment->description); + echo format_text($assignment->description, $assignment->format); print_simple_box_end(); echo "
"; -- 2.39.5