From e532301f7ef393940fc0382555661992f55d63c1 Mon Sep 17 00:00:00 2001 From: Irina Hoppe Date: Tue, 6 Aug 2024 14:06:39 +0200 Subject: [PATCH] codestyle fix --- classes/completion/custom_completion.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/classes/completion/custom_completion.php b/classes/completion/custom_completion.php index 6cb164cd..554c1210 100644 --- a/classes/completion/custom_completion.php +++ b/classes/completion/custom_completion.php @@ -49,7 +49,7 @@ public function get_state(string $rule): int { $course = $this->cm->get_course(); $instance = $this->cm->instance; - if (!$ratingallocaterecord= $DB->get_record('ratingallocate', ['id' => $instance])) { + if (!$ratingallocaterecord = $DB->get_record('ratingallocate', ['id' => $instance])) { throw new \moodle_exception('Unable to find ratingallocate instance with id ' . $instance); } @@ -60,19 +60,8 @@ public function get_state(string $rule): int { if ($rule == 'completionvote') { $status = count($ratingallocate->get_rating_data_for_user($userid)) > 0; - /* - $sql = "SELECT * FROM {ratingallocate_ratings} r INNER JOIN {ratingallocate_choices} c on r.choiceid=c.id " . - "WHERE r.userid= :userid AND c.ratingallocateid= :ratingallocateid"; - $votesofuser = $DB->get_records_sql($sql, ['userid' => $userid, 'ratingallocateid' => $ratingallocateid]); - $status = count($votesofuser) > 0; - */ } else if ($rule == 'completionallocation') { $status = count($ratingallocate->get_allocations_for_user($userid)) > 0; - /* - $sql = "SELECT * FROM {ratingallocate_allocations} WHERE userid= :userid AND ratingallocateid= :ratingallocateid"; - $allocationsofuser = $DB->get_records_sql($sql, ['userid' => $userid, 'ratingallocateid' => $ratingallocateid]); - $status = count($allocationsofuser) > 0; - */ } return $status ? COMPLETION_COMPLETE : COMPLETION_INCOMPLETE;