diff --git a/grade/edit/outcome/edit_form.php b/grade/edit/outcome/edit_form.php index 6cb718e56af..b7827c77698 100644 --- a/grade/edit/outcome/edit_form.php +++ b/grade/edit/outcome/edit_form.php @@ -10,11 +10,11 @@ class edit_outcome_form extends moodleform { // visible elements $mform->addElement('header', 'general', get_string('outcomes', 'grades')); - $mform->addElement('text', 'fullname', get_string('fullname')); + $mform->addElement('text', 'fullname', get_string('fullname'), 'size="40"'); $mform->addRule('fullname', get_string('required'), 'required'); $mform->setType('fullname', PARAM_TEXT); - $mform->addElement('text', 'shortname', get_string('shortname')); + $mform->addElement('text', 'shortname', get_string('shortname'), 'size="20"'); $mform->addRule('shortname', get_string('required'), 'required'); $mform->setType('shortname', PARAM_NOTAGS); @@ -25,6 +25,8 @@ class edit_outcome_form extends moodleform { $mform->addElement('select', 'scaleid', get_string('scale'), $options); $mform->addRule('scaleid', get_string('required'), 'required'); + $mform->addElement('htmleditor', 'description', get_string('description'), array('cols'=>80, 'rows'=>20)); + // hidden params $mform->addElement('hidden', 'id', 0); diff --git a/grade/edit/scale/edit_form.php b/grade/edit/scale/edit_form.php index 771efe1edac..7539410f373 100644 --- a/grade/edit/scale/edit_form.php +++ b/grade/edit/scale/edit_form.php @@ -10,7 +10,7 @@ class edit_scale_form extends moodleform { // visible elements $mform->addElement('header', 'general', get_string('scale')); - $mform->addElement('text', 'name', get_string('name')); + $mform->addElement('text', 'name', get_string('name'), 'size="40"'); $mform->addRule('name', get_string('required'), 'required', null, 'client'); $mform->setType('name', PARAM_TEXT); diff --git a/lib/db/install.xml b/lib/db/install.xml index 8e877dbac67..1ed0ce1b596 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -1280,8 +1280,9 @@ - - + + + @@ -1420,7 +1421,8 @@ - + + @@ -1670,4 +1672,4 @@ - + \ No newline at end of file diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 57cacfc7a5e..e47a55ea191 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1045,6 +1045,7 @@ function xmldb_main_upgrade($oldversion=0) { $table->addFieldInfo('shortname', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null); $table->addFieldInfo('fullname', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null); $table->addFieldInfo('scaleid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); + $table->addFieldInfo('description', XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null); $table->addFieldInfo('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); $table->addFieldInfo('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); $table->addFieldInfo('usermodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); @@ -1197,6 +1198,7 @@ function xmldb_main_upgrade($oldversion=0) { $table->addFieldInfo('shortname', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null); $table->addFieldInfo('fullname', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null); $table->addFieldInfo('scaleid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); + $table->addFieldInfo('description', XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null); /// Adding keys to table grade_outcomes_history $table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id')); @@ -1531,6 +1533,26 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && add_field($table, $field); } + if ($result && $oldversion < 2007073105) { + + /// Define field description to be added to grade_outcomes + $table = new XMLDBTable('grade_outcomes'); + $field = new XMLDBField('description'); + if (!field_exists($table, $field)) { + $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'scaleid'); + /// Launch add field description + $result = $result && add_field($table, $field); + } + + $table = new XMLDBTable('grade_outcomes_history'); + $field = new XMLDBField('description'); + if (!field_exists($table, $field)) { + $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'scaleid'); + /// Launch add field description + $result = $result && add_field($table, $field); + } + + } /* diff --git a/lib/grade/grade_outcome.php b/lib/grade/grade_outcome.php index 819677ed221..077fd629157 100644 --- a/lib/grade/grade_outcome.php +++ b/lib/grade/grade_outcome.php @@ -72,6 +72,12 @@ class grade_outcome extends grade_object { */ var $scaleid; + /** + * The description of this outcome - FORMAT_MOODLE. + * @var string $description + */ + var $description; + /** * The userid of the person who last modified this outcome. * @var int $usermodified @@ -223,11 +229,11 @@ class grade_outcome extends grade_object { } /** - * Returns outcome short name. + * Returns unique outcome short name. * @return string name */ function get_shortname() { - return format_string($this->shortname); + return $this->shortname; } /** diff --git a/version.php b/version.php index baa4822ec31..cfd1c685fc9 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007073104; // YYYYMMDD = date + $version = 2007073105; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name