Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

rating MDL-22412 removed references to legacy ratings tables

  • Loading branch information...
commit ae2760856454b1b453e6b621030acf25456b32c9 1 parent a7ab614
Andrew Davis authored

Showing 2 changed files with 0 additions and 17 deletions. Show diff stats Hide diff stats

  1. +0 3  mod/data/lib.php
  2. +0 14 mod/glossary/lib.php
3  mod/data/lib.php
@@ -2412,7 +2412,6 @@ function data_reset_userdata($data) {
2412 2412
2413 2413 // delete entries if requested
2414 2414 if (!empty($data->reset_data)) {
2415   - //$DB->delete_records_select('data_ratings', "recordid IN ($allrecordssql)", array($data->courseid));
2416 2415 $DB->delete_records_select('comments', "itemid IN ($allrecordssql) AND commentarea='database_entry'", array($data->courseid));
2417 2416 $DB->delete_records_select('data_content', "recordid IN ($allrecordssql)", array($data->courseid));
2418 2417 $DB->delete_records_select('data_records', "dataid IN ($alldatassql)", array($data->courseid));
@@ -2454,7 +2453,6 @@ function data_reset_userdata($data) {
2454 2453 if (array_key_exists($record->userid, $notenrolled) or !$record->userexists or $record->userdeleted
2455 2454 or !is_enrolled($course_context, $record->userid)) {
2456 2455 //delete ratings
2457   - //$DB->delete_records('data_ratings', array('recordid'=>$record->id));
2458 2456 if (!$cm = get_coursemodule_from_instance('data', $record->dataid)) {
2459 2457 continue;
2460 2458 }
@@ -2487,7 +2485,6 @@ function data_reset_userdata($data) {
2487 2485
2488 2486 // remove all ratings
2489 2487 if (!empty($data->reset_data_ratings)) {
2490   - //$DB->delete_records_select('data_ratings', "recordid IN ($allrecordssql)", array($data->courseid));
2491 2488 if ($datas = $DB->get_records_sql($alldatassql, array($data->courseid))) {
2492 2489 foreach ($datas as $dataid=>$unused) {
2493 2490 if (!$cm = get_coursemodule_from_instance('data', $dataid)) {
14 mod/glossary/lib.php
@@ -415,20 +415,6 @@ function glossary_cron () {
415 415 * @return array array of grades, false if none
416 416 */
417 417 function glossary_get_user_grades($glossary, $userid=0) {
418   - /*global $DB;
419   -
420   - $params = array('userid'=>$userid, 'gid'=>$glossary->id);
421   -
422   - $user = $userid ? "AND u.id = :userid" : "";
423   -
424   - $sql = "SELECT u.id, u.id AS userid, avg(gr.rating) AS rawgrade
425   - FROM {user} u, {glossary_entries} ge, {glossary_ratings} gr
426   - WHERE u.id = ge.userid AND ge.id = gr.entryid
427   - AND gr.userid != u.id AND ge.glossaryid = :gid
428   - $user
429   - GROUP BY u.id";
430   -
431   - return $DB->get_records_sql($sql, $params);*/
432 418 global $CFG;
433 419
434 420 require_once($CFG->dirroot.'/rating/lib.php');

0 comments on commit ae27608

Please sign in to comment.
Something went wrong with that request. Please try again.