Commit ac6beb75 authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-47494 gapselect: Improve file handling in overall feedback.

parent 769fd123
......@@ -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');
}
}
......@@ -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);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment