Commit b2f77904 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1795273: delete lti submission when deleting a page"

parents a3978dcd 3a45fcd3
......@@ -153,6 +153,9 @@ class Collection {
delete_records('collection_view','collection',$this->id);
delete_records('tag', 'resourcetype', 'collection', 'resourceid', $this->id);
if (is_plugin_active('lti', 'module')) {
delete_records('lti_assessment_submission', 'collectionid', $this->id);
}
delete_records('collection','id',$this->id);
delete_records('existingcopy', 'collection', $this->id);
......
......@@ -945,6 +945,14 @@ function group_delete($groupid, $shortname=null, $institution=null, $notifymembe
$forum->delete();
}
// Delete lti submissions to the group if they exist
if (is_plugin_active('lti', 'module')) {
foreach (get_column('lti_assessment', 'id', 'group', $group->id) as $assessmentid) {
delete_records('lti_assessment_submission', 'ltiassessment', $assessmentid);
}
delete_records('lti_assessment', 'group', $group->id);
}
if ($notifymembers) {
require_once('activity.php');
activity_occurred('groupmessage', array(
......
......@@ -1014,6 +1014,9 @@ class View {
handle_event('deleteview', $eventdata);
delete_records('view_rows_columns', 'view', $this->id);
if (is_plugin_active('lti', 'module')) {
delete_records('lti_assessment_submission', 'viewid', $this->id);
}
delete_records('view','id',$this->id);
if (!empty($this->owner) && $this->is_submitted()) {
// There should be no way to delete a submitted view,
......
Markdown is supported
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