public function resetPeerReviews() { global $ilDB; if ($this->hasPeerReviewGroups()) { // ratings foreach ($this->getAllPeerReviews(false) as $peer_id => $reviews) { foreach ($reviews as $giver_id => $review) { ilRating::resetRatingForUserAndObject($this->getId(), "ass", $peer_id, "peer", $giver_id); } } // files $this->resetPeerReviewFileUploads(); // peer groups $ilDB->manipulate("DELETE FROM exc_assignment_peer" . " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer")); } }
function updatePageRating() { global $ilUser; $pg_id = $_GET["pgid"]; if (!$this->ctrl->isAsynch() || !$pg_id) { exit; } include_once './Services/Rating/classes/class.ilRating.php'; $rating = (int) $_POST["rating"]; if ($rating) { ilRating::writeRatingForUserAndObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId(), $_POST["rating"]); } else { ilRating::resetRatingForUserAndObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId()); } include_once './Services/Rating/classes/class.ilRatingGUI.php'; $rating = new ilRatingGUI(); $rating->setObject($this->lm->getId(), "lm", $pg_id, "lm", $ilUser->getId()); $rating->setYourRatingText($this->lng->txt("lm_rate_page")); echo $rating->getHtml(true, true, "il.LearningModule.saveRating(%rating%);"); echo $this->tpl->getOnLoadCodeForAsynch(); exit; }
/** * Reset Rating */ function resetUserRating() { ilRating::resetRatingForUserAndObject($this->obj_id, $this->obj_type, $this->sub_obj_id, $this->sub_obj_type, $this->getUserId()); }