function updateUser() { global $ilDB; $query = "DELETE FROM event_participants " . "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " " . "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " "; $res = $ilDB->manipulate($query); $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated" . ") VALUES( " . $ilDB->quote($this->getEventId(), 'integer') . ", " . $ilDB->quote($this->getUserId(), 'integer') . ", " . $ilDB->quote($this->getRegistered(), 'integer') . ", " . $ilDB->quote($this->getParticipated(), 'integer') . ")"; $res = $ilDB->manipulate($query); include_once "Services/Tracking/classes/class.ilLPMarks.php"; $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId()); $lp_mark->setComment($this->getComment()); $lp_mark->setMark($this->getMark()); $lp_mark->update(); // refresh learning progress status after updating participant include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($this->getEventId(), $this->getUserId()); return true; }
/** * Save grades */ function saveGradesObject() { global $ilCtrl, $lng; $this->checkPermission("write"); include_once 'Services/Tracking/classes/class.ilLPMarks.php'; if (is_array($_POST["lcomment"])) { foreach ($_POST["lcomment"] as $k => $v) { $marks_obj = new ilLPMarks($this->object->getId(), (int) $k); $marks_obj->setComment(ilUtil::stripSlashes($v)); $marks_obj->setMark(ilUtil::stripSlashes($_POST["mark"][$k])); $marks_obj->update(); } } ilUtil::sendSuccess($lng->txt("exc_msg_saved_grades"), true); $ilCtrl->redirect($this, "showGradesOverview"); }
function saveProgress() { global $ilUser; include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $lp_marks = new ilLPMarks($this->gui_object->object->getId(), $ilUser->getId()); $lp_marks->setCompleted((bool) $_POST['lp_edit']); $lp_marks->update(); require_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php'; ilLPStatusWrapper::_updateStatus($this->gui_object->object->getId(), $ilUser->getId()); $this->lng->loadLanguageModule('trac'); ilUtil::sendSuccess($this->lng->txt('trac_updated_status'), true); $this->ctrl->redirect($this, ""); // #14993 // $this->showSummary(); }
function __updateUser($user_id, $obj_id) { $form = $this->initEditUserForm($user_id, $obj_id); if ($form->checkInput()) { include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($obj_id, $user_id); $marks->setMark($form->getInput("mark")); $marks->setComment($form->getInput("comment")); $do_lp = false; // status/completed is optional $status = $form->getItemByPostVar("completed"); if (is_object($status)) { if ($marks->getCompleted() != $form->getInput("completed")) { $marks->setCompleted($form->getInput("completed")); $do_lp = true; } } $marks->update(); // #11600 if ($do_lp) { include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($obj_id, $user_id); } } }
function __updateUser($user_id, $obj_id) { include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($obj_id, $user_id); $marks->setMark(ilUtil::stripSlashes($_POST['mark'])); $marks->setComment(ilUtil::stripSlashes($_POST['comment'])); $marks->setCompleted((bool) $_POST['completed']); $marks->update(); include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($obj_id, $user_id); }
public function setLearningProgress($a_ref_id, $a_user) { include_once './Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($this->ref_id, $this->user_id); $marks->setMark($this->params["event_integer"]); $marks->setComment($this->params["event_text"]); if ($this->isNewEntry($a_ref_id, $a_user)) { $marks->__add(); } else { $marks->update(); } }
/** * Test LP marks * @param * @return */ public function testLPMarks() { include_once './Services/Tracking/classes/class.ilLPMarks.php'; include_once './Services/Tracking/classes/class.ilLPStatusFactory.php'; $marks = new ilLPMarks(999, 888); $marks->setMark('Gut'); $marks->setComment('Weiter so'); $marks->setCompleted(true); $marks->update(); $marks = new ilLPMarks(999, 888); $mark = $marks->getMark(); $this->assertEquals($mark, 'Gut'); $comment = ilLPMarks::_lookupComment(888, 999); $this->assertEquals($comment, 'Weiter so'); $class = ilLPStatusFactory::_getClassById(999, ilLPObjSettings::LP_MODE_MANUAL); $completed = $class::_getCompleted(999); $this->assertEquals(array(888), $completed); ilLPMarks::deleteObject(999); }
function __updateUser($user_id, $obj_id) { global $ilUser; include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($obj_id, $user_id); $marks->setMark(ilUtil::stripSlashes($_POST['mark'])); $marks->setComment(ilUtil::stripSlashes($_POST['comment'])); $do_lp = false; if ($marks->getCompleted() != (bool) $_POST['completed']) { $marks->setCompleted((bool) $_POST['completed']); $do_lp = true; } $marks->update(); // #11600 if ($do_lp) { include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($obj_id, $user_id); } }
/** * sync course status and lp status * * @param int $a_member_id * @param bool $a_has_passed */ protected function updateLPFromStatus($a_member_id, $a_has_passed) { global $ilUser; include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (ilObjUserTracking::_enabledLearningProgress() && $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) { include_once './Services/Object/classes/class.ilObjectLP.php'; $olp = ilObjectLP::getInstance($this->object->getId()); if ($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR) { include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($this->object->getId(), $a_member_id); // only if status has changed if ($marks->getCompleted() != $a_has_passed) { $marks->setCompleted($a_has_passed); $marks->update(); include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($this->object->getId(), $a_member_id, null, false, true); } } } }
/** * Save grading */ function saveGradingObject() { global $ilCtrl, $lng; $this->checkPermission("write"); $users = is_array($_POST["user_id"]) ? $_POST["user_id"] : array(); include_once "./Modules/Wiki/classes/class.ilWikiContributor.php"; include_once "./Services/Tracking/classes/class.ilLPMarks.php"; $saved = false; foreach ($users as $user_id) { if ($user_id != "") { $marks_obj = new ilLPMarks($this->object->getId(), $user_id); $new_mark = ilUtil::stripSlashes($_POST['mark'][$user_id]); $new_comment = ilUtil::stripSlashes($_POST['lcomment'][$user_id]); $new_status = ilUtil::stripSlashes($_POST["status"][$user_id]); if ($marks_obj->getMark() != $new_mark || $marks_obj->getComment() != $new_comment || ilWikiContributor::_lookupStatus($this->object->getId(), $user_id) != $new_status) { ilWikiContributor::_writeStatus($this->object->getId(), $user_id, $new_status); $marks_obj->setMark($new_mark); $marks_obj->setComment($new_comment); $marks_obj->update(); $saved = true; } } } if ($saved) { ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true); } $ilCtrl->redirect($this, "listContributors"); }
/** * sync course status and lp status * * @param int $a_member_id * @param bool $a_has_passed */ protected function updateLPFromStatus($a_member_id, $a_has_passed) { include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (ilObjUserTracking::_enabledLearningProgress() && $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) { include_once './Services/Tracking/classes/class.ilLPObjSettings.php'; $lp_settings = new ilLPObjSettings($this->object->getId()); if ($lp_settings->getMode() == LP_MODE_MANUAL_BY_TUTOR) { include_once 'Services/Tracking/classes/class.ilLPMarks.php'; $marks = new ilLPMarks($this->object->getId(), $a_member_id); $marks->setCompleted($a_has_passed); $marks->update(); include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php"; ilLPStatusWrapper::_updateStatus($this->object->getId(), $a_member_id, null, false, true); } } }