Skip to content
Browse files

MDL-37543 Assignment upgrade: convert advanced upload files "Send for…

… marking" setting

Advanced upload files assignment type has "Enable send for marking" setting instead
of "Allow resubmissions". Needs special handling in upgrade code to convert to
"Require students click submit button".

Conflicts:

	mod/assign/submission/file/locallib.php
  • Loading branch information...
1 parent 2540839 commit 5132e88b10c3b1be4fa52a2b8343929771410155 @damyon damyon committed Jan 17, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 mod/assign/submission/file/locallib.php
View
11 mod/assign/submission/file/locallib.php
@@ -301,14 +301,21 @@ public function can_upgrade($type, $version) {
* @return bool Was it a success? (false will trigger rollback)
*/
public function upgrade_settings(context $oldcontext,stdClass $oldassignment, & $log) {
+ global $DB;
+
if ($oldassignment->assignmenttype == 'uploadsingle') {
$this->set_config('maxfilesubmissions', 1);
$this->set_config('maxsubmissionsizebytes', $oldassignment->maxbytes);
return true;
- }else {
-
+ } else if ($oldassignment->assignmenttype == 'upload') {
$this->set_config('maxfilesubmissions', $oldassignment->var1);
$this->set_config('maxsubmissionsizebytes', $oldassignment->maxbytes);
+
+ // Advanced file upload uses a different setting to do the same thing.
+ $DB->set_field('assign',
+ 'submissiondrafts',
+ $oldassignment->var4,
+ array('id'=>$this->assignment->get_instance()->id));
return true;
}

0 comments on commit 5132e88

Please sign in to comment.
Something went wrong with that request. Please try again.