rating MDL-23586 made mod data delete ratings when an instance is deleted

This commit is contained in:
Andrew Davis
2010-08-09 08:46:52 +00:00
parent 9f60f914d8
commit d2e09d60d7
+8
View File
@@ -908,6 +908,14 @@ function data_delete_instance($id) { // takes the dataid
require_once($CFG->dirroot.'/comment/lib.php');
comment::delete_comments(array('contextid'=>$context->id));
// Delete ratings
//delete ratings
require_once($CFG->dirroot.'/rating/lib.php');
$delopt = new stdclass();
$delopt->contextid = $context->id;
$rm = new rating_manager();
$rm->delete_ratings($delopt);
// get all the records in this data
$sql = "SELECT r.id
FROM {data_records} r