Project: moodle
Issue MDL-40921: Replace add_to_log with an event trigger - mod_workshop
Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class. *mod_workshop* /mod/workshop/index.php:36: add_to_log($course->id, 'workshop', 'view all', "index.php?id=$course->id", ''); /mod/workshop/locallib.php:1525: add_to_log($this->course->id, 'workshop', $action, $logurl, $info, $this->cm->id); *check out this function:* /mod/workshop/locallib.php:1514 log() *Check out these class to the log function* /mod/workshop/aggregate.php:56 $workshop->log('update aggregate grades'); /mod/workshop/assessment.php:162 $workshop->log('add assessment', $workshop->assess_url($assessment->id), $assessment->submissionid); /mod/workshop/assessment.php:164 $workshop->log('update assessment', $workshop->assess_url($assessment->id), $assessment->submissionid); mod/workshop/exassessment.php:92 $workshop->log('add reference assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid); mod/workshop/exassessment.php:94 $workshop->log('update reference assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid); mod/workshop/exassessment.php:98 $workshop->log('add example assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid); mod/workshop/exassessment.php:100 $workshop->log('update example assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid); mod/workshop/exsubmission.php:60 $workshop->log('view example', $workshop->exsubmission_url($example->id), $example->id); mod/workshop/exsubmission.php:165 $workshop->log('add example', $workshop->exsubmission_url($example->id), $example->id); mod/workshop/exsubmission.php:167 $workshop->log('update example', $workshop->exsubmission_url($example->id), $example->id); mod/workshop/lib.php:950 $workshop->log('update switch phase', $workshop->view_url(), $workshop->phase); mod/workshop/submission.php:54 $workshop->log('view submission', $workshop->submission_url($submission->id), $submission->id); mod/workshop/submission.php:192 $workshop->log('add submission', $workshop->submission_url($submission->id), $submission->id); mod/workshop/submission.php:194 $workshop->log('update submission', $workshop->submission_url($submission->id), $submission->id); mod/workshop/toolbox.php:44 $workshop->log('update clear aggregated grades'); mod/workshop/toolbox.php:51 $workshop->log('update clear assessments'); mod/workshop/view.php:57 $workshop->log('view'); mod/workshop/view.php:74 $workshop->log('update switch phase', $workshop->view_url(), $workshop->phase); *Also check out the following* mod/workshop/allocation/scheduled/lib.php:237: $result->log($data->settings, 'debug'); mod/workshop/allocation/random/lib.php:111: $result->log(get_string('numofrandomlyallocatedsubmissions', 'workshopallocation_random', count($randomallocations))); mod/workshop/allocation/random/lib.php:117: $result->log(get_string('numofselfallocatedsubmissions', 'workshopallocation_random', count($selfallocations))); mod/workshop/allocation/random/lib.php:121: $result->log(get_string('noallocationtoadd', 'workshopallocation_random'), 'info'); mod/workshop/allocation/random/lib.php:155: $result->log(get_string('allocationaddeddetail', 'workshopallocation_random', $a), 'ok', 1); mod/workshop/allocation/random/lib.php:157: $result->log(get_string('allocationreuseddetail', 'workshopallocation_random', $a), 'ok', 1); mod/workshop/allocation/random/lib.php:165: $result->log(get_string('numofdeallocatedassessment', 'workshopallocation_random', count($delassessments)), 'info'); mod/workshop/allocation/random/lib.php:175: $result->log(get_string('allocationdeallocategraded', 'workshopallocation_random', $a), 'error', 1); mod/workshop/allocation/random/lib.php:178: $result->log(get_string('assessmentdeleteddetail', 'workshopallocation_random', $a), 'info', 1); mod/workshop/allocation/random/lib.php:452: $result->log(get_string('resultnumperauthor', 'workshopallocation_random', $numofreviews), 'info'); mod/workshop/allocation/random/lib.php:459: $result->log(get_string('resultnumperreviewer', 'workshopallocation_random', $numofreviews), 'info'); mod/workshop/allocation/random/lib.php:512: $result->log('processing circle group id ' . $circlegroupid, 'debug'); mod/workshop/allocation/random/lib.php:520: $result->log('iteration ' . $requiredreviews, 'debug'); mod/workshop/allocation/random/lib.php:523: $result->log('skipping circle id ' . $circleid, 'debug'); mod/workshop/allocation/random/lib.php:526: $result->log('processing circle id ' . $circleid, 'debug'); mod/workshop/allocation/random/lib.php:539: $result->log(get_string('resultnomorepeers', 'workshopallocation_random'), 'error', 1); mod/workshop/allocation/random/lib.php:546: $result->log(get_string('resultnomorepeersingroup', 'workshopallocation_random'), 'error', 1); mod/workshop/allocation/random/lib.php:567: $result->log(get_string('resultnotenoughpeers', 'workshopallocation_random'), 'error', 1); mod/workshop/allocation/random/lib.php:570: $result->log('next square should be from group id ' . $targetgroup, 'debug', 1); mod/workshop/allocation/random/lib.php:578: $result->log('unable to find an available square. trying another group', 'debug', 1); mod/workshop/allocation/random/lib.php:582: $result->log('target square = ' . $targetsquare, 'debug', 1); mod/workshop/allocation/random/lib.php:587: $result->log('increasing square workload to ' . $squareworkload[$targetsquare], 'debug', 1); mod/workshop/allocation/random/lib.php:595: $result->log('increasing group workload to ' . $squaregroupsworkload[$targetgroup], 'debug', 1);
Story points: 40