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:
skodak 2006-10-18 11:14:48 +00:00
parent c081fdcaca
commit 1f8c654979

View File

@ -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;
}