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
This commit is contained in:
Damyon Wiese
2013-01-17 11:29:58 +08:00
parent 5919718019
commit 5be632e8b6
+9 -2
View File
@@ -301,14 +301,21 @@ class assign_submission_file extends assign_submission_plugin {
* @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;
}