MDL-47494 gapselect: Merge branch 'master' of git://github.com/timhunt/moodle-qtype_gapselect

This commit is contained in:
Jamie Pratt
2011-10-13 19:07:43 +07:00
2 changed files with 2 additions and 26 deletions
@@ -68,17 +68,4 @@ class backup_qtype_gapselect_plugin extends backup_qtype_plugin {
return $plugin;
}
/**
* Returns one array with filearea => mappingname elements for the qtype
*
* Used by {@link get_components_and_fileareas} to know about all the qtype
* files to be processed both in backup and restore.
*/
public static function get_qtype_fileareas() {
return array(
'correctfeedback' => 'question_created',
'partiallycorrectfeedback' => 'question_created',
'incorrectfeedback' => 'question_created');
}
}
+2 -13
View File
@@ -312,22 +312,11 @@ abstract class qtype_gapselect_base extends question_type {
public function move_files($questionid, $oldcontextid, $newcontextid) {
parent::move_files($questionid, $oldcontextid, $newcontextid);
$fs = get_file_storage();
$fs->move_area_files_to_new_context($oldcontextid,
$newcontextid, 'question', 'correctfeedback', $questionid);
$fs->move_area_files_to_new_context($oldcontextid,
$newcontextid, 'question', 'partiallycorrectfeedback', $questionid);
$fs->move_area_files_to_new_context($oldcontextid,
$newcontextid, 'question', 'incorrectfeedback', $questionid);
$this->move_files_in_combined_feedback($questionid, $oldcontextid, $newcontextid);
}
protected function delete_files($questionid, $contextid) {
parent::delete_files($questionid, $contextid);
$fs = get_file_storage();
$fs->delete_area_files($contextid, 'question', 'correctfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'partiallycorrectfeedback', $questionid);
$fs->delete_area_files($contextid, 'question', 'incorrectfeedback', $questionid);
$this->delete_files_in_combined_feedback($questionid, $contextid);
}
}