Skip to content

Commit

Permalink
Merge branch 'MDL-37543-master' of git://github.com/damyon/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Aparup Banerjee committed Jan 22, 2013
2 parents cccdddf + 01d29b3 commit 5d4183b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mod/assign/submission/file/locallib.php
Expand Up @@ -344,13 +344,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;
}
}
Expand Down

0 comments on commit 5d4183b

Please sign in to comment.