Permalink
Browse files

MDL-37602 Add new fields into the workshop table to hold the feature …

…settings

These three fields hold the per-instance settings for the new Overall
feedback feature. Expected values in the new overallfeedbackmode fields are:
0 - the feature is disabled in this workshop instance
1 - overall feedback is optional (default)
2 - overall feedback is required (i.e. the reviewer must put some text
into the overall feedback field).

Files can be attached to the overall feedback text field, if the field
overallfeedbackfiles > 0 and the feature is enabled (i.e. it is optional
or required). The actual number of attached files is not checked in the
required mode (i.e. attaching files is always optional, if it is
allowed).
  • Loading branch information...
1 parent 373a8e0 commit 7426229f125dd85e7a2fe868e1043028aa324e29 @mudrd8mz mudrd8mz committed Mar 25, 2013
Showing with 29 additions and 2 deletions.
  1. +4 −1 mod/workshop/db/install.xml
  2. +24 −0 mod/workshop/db/upgrade.php
  3. +1 −1 mod/workshop/version.php
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/workshop/db" VERSION="20121024" COMMENT="XMLDB file for Moodle mod/workshop"
+<XMLDB PATH="mod/workshop/db" VERSION="20130325" COMMENT="XMLDB file for Moodle mod/workshop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
@@ -36,6 +36,9 @@
<FIELD NAME="phaseswitchassessment" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Automatically switch to the assessment phase after the submissions deadline"/>
<FIELD NAME="conclusion" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="A text to be displayed at the end of the workshop."/>
<FIELD NAME="conclusionformat" TYPE="int" LENGTH="3" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="The format of the conclusion field content."/>
+ <FIELD NAME="overallfeedbackmode" TYPE="int" LENGTH="3" NOTNULL="false" DEFAULT="1" SEQUENCE="false" COMMENT="Mode of the overall feedback support."/>
+ <FIELD NAME="overallfeedbackfiles" TYPE="int" LENGTH="3" NOTNULL="false" DEFAULT="0" SEQUENCE="false" COMMENT="Number of allowed attachments to the overall feedback."/>
+ <FIELD NAME="overallfeedbackmaxbytes" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="100000" SEQUENCE="false" COMMENT="Maximum size of one file attached to the overall feedback."/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
@@ -112,6 +112,30 @@ function xmldb_workshop_upgrade($oldversion) {
// Moodle v2.4.0 release upgrade line
// Put any upgrade step following this
+ /**
+ * Add overall feedback related fields into the workshop table.
+ */
+ if ($oldversion < 2013032500) {
+ $table = new xmldb_table('workshop');
+
+ $field = new xmldb_field('overallfeedbackmode', XMLDB_TYPE_INTEGER, '3', null, null, null, '1', 'conclusionformat');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ $field = new xmldb_field('overallfeedbackfiles', XMLDB_TYPE_INTEGER, '3', null, null, null, '0', 'overallfeedbackmode');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ $field = new xmldb_field('overallfeedbackmaxbytes', XMLDB_TYPE_INTEGER, '10', null, null, null, '100000', 'overallfeedbackfiles');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ upgrade_mod_savepoint(true, 2013032500, 'workshop');
+ }
+
return true;
}
View
@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
-$module->version = 2013013100; // the current module version (YYYYMMDDXX)
+$module->version = 2013032500; // the current module version (YYYYMMDDXX)
$module->requires = 2013012500; // requires this Moodle version
$module->component = 'mod_workshop'; // full name of the plugin (used for diagnostics)
$module->cron = 60; // give as a chance every minute

0 comments on commit 7426229

Please sign in to comment.