MDL-37540 Assignment upgrade: Upgrade setting "Hide description before due date"
authorDamyon Wiese <damyon@moodle.com>
Thu, 17 Jan 2013 03:44:57 +0000 (11:44 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 17 Jan 2013 03:57:10 +0000 (11:57 +0800)
Advanced upload of files has this setting which is stored in var3.

mod/assign/submission/file/locallib.php

index 6e0f5c5..ec7063e 100644 (file)
@@ -316,6 +316,16 @@ class assign_submission_file extends assign_submission_plugin {
                            'submissiondrafts',
                            $oldassignment->var4,
                            array('id'=>$this->assignment->get_instance()->id));
+
+            // Convert advanced file upload "hide description before due date" setting.
+            $alwaysshow = 0;
+            if (!$oldassignment->var3) {
+                $alwaysshow = 1;
+            }
+            $DB->set_field('assign',
+                           'alwaysshowdescription',
+                           $alwaysshow,
+                           array('id'=>$this->assignment->get_instance()->id));
             return true;
         }