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;
 }
示例#2
0
 /**
  * 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 __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);
         }
     }
 }
 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();
     }
 }
 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);
 }
示例#6
0
 /**
  * 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);
     }
 }
示例#8
0
 /**
  * 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");
 }