mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
Deleting uploaded files when deleting an assignment instance + fixed quoting style + trailing whitespace MDL-6387 ; merged from MOODLE_17_STABLE
This commit is contained in:
parent
c081fdcaca
commit
1f8c654979
@ -444,11 +444,13 @@ class assignment_base {
|
||||
/**
|
||||
* Deletes an assignment activity
|
||||
*
|
||||
* Deletes all database records and calendar events for this assignment.
|
||||
* Deletes all database records, files and calendar events for this assignment.
|
||||
* @param $assignment object The assignment to be deleted
|
||||
* @return boolean False indicates error
|
||||
*/
|
||||
function delete_instance($assignment) {
|
||||
global $CFG;
|
||||
|
||||
$result = true;
|
||||
|
||||
if (! delete_records('assignment_submissions', 'assignment', $assignment->id)) {
|
||||
@ -473,6 +475,10 @@ class assignment_base {
|
||||
}
|
||||
}
|
||||
|
||||
// delete file area with all attachments - ignore errors
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
fulldelete($CFG->dataroot.'/'.$assignment->course.'/'.$CFG->moddata.'/assignment/'.$assignment->id);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user