ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLearningProgressBaseGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
35 define("LP_MODE_PERSONAL_DESKTOP",1);
36 define("LP_MODE_ADMINISTRATION",2);
37 define("LP_MODE_REPOSITORY",3);
38 define("LP_MODE_USER_FOLDER",4);
39 
40 define("LP_ACTIVE_SETTINGS",1);
41 define("LP_ACTIVE_OBJECTS",2);
42 define("LP_ACTIVE_PROGRESS",3);
43 define("LP_ACTIVE_LM_STATISTICS",4);
44 define("LP_ACTIVE_USERS",5);
45 define("LP_ACTIVE_SUMMARY",6);
46 
47 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
48 
49 /* Base class for all Learning progress gui classes.
50  * Defines modes for presentation according to the context in which it was called
51  * E.g: mode LP_MODE_PERSONAL_DESKTOP displays only listOfObjects.
52  */
53 
55 {
56  var $tpl = null;
57  var $ctrl = null;
58  var $lng = null;
59 
60  var $ref_id = 0;
61 
62  var $mode = 0;
63 
64  var $statistics_activated = false; // show sub tab for access statistics
65 
66  function ilLearningProgressBaseGUI($a_mode,$a_ref_id = 0,$a_usr_id = 0)
67  {
68  global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
69 
70  $this->tpl =& $tpl;
71  $this->ctrl =& $ilCtrl;
72  $this->lng =& $lng;
73  $this->lng->loadLanguageModule('trac');
74  $this->tabs_gui =& $ilTabs;
75 
76  $this->mode = $a_mode;
77  $this->ref_id = $a_ref_id;
78  $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
79  $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
80  $this->usr_id = $a_usr_id;
81 
82  $this->anonymized = (bool) !ilObjUserTracking::_enabledUserRelatedData();
83  }
84 
85  function activePDF()
86  {
87  return $this->active_pdf;
88  }
89 
90  function __checkPDF()
91  {
92  include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
93  $rpc_server = ilRPCServerSettings::getInstance();
94  $this->active_pdf = $rpc_server->getHost() ? true : false;
95  }
96 
97  function isAnonymized()
98  {
99  return $this->anonymized;
100  }
101 
103  {
104  switch($this->obj_type)
105  {
106  case 'tst':
107  include_once './Modules/Test/classes/class.ilObjTest.php';
108  if(ilObjTest::_lookupAnonymity($this->obj_id))
109  {
110  return true;
111  }
112  default:
113  return false;
114  }
115  return false;
116  }
117 
118  function getMode()
119  {
120  return $this->mode;
121  }
122 
123  function getRefId()
124  {
125  return $this->ref_id;
126  }
127 
128  function getObjId()
129  {
130  return $this->obj_id;
131  }
132 
133  function getUserId()
134  {
135  if($this->usr_id)
136  {
137  return $this->usr_id;
138  }
139  if((int) $_GET['user_id'])
140  {
141  return (int) $_GET['user_id'];
142  }
143  return 0;
144  }
145 
146  function activateStatistics($a_act = true)
147  {
148  $this->statistics_activated = $a_act;
149  }
150 
151  // Protected
153  {
154  if(strlen($cmd = $this->ctrl->getCmd()))
155  {
156  return $cmd;
157  }
158  return 'show';
159  }
160 
161  function __setSubTabs($a_active)
162  {
163  global $rbacsystem,$ilObjDataCache,$lng;
164 
165 
166 
167  switch($this->getMode())
168  {
170 
171  $this->tabs_gui->addSubTabTarget('trac_progress',
172  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
173  "","","",$a_active == LP_ACTIVE_PROGRESS);
174  $this->tabs_gui->addSubTabTarget('trac_objects',
175  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
176  "","","",$a_active == LP_ACTIVE_OBJECTS);
177  break;
178 
179 
180  case LP_MODE_REPOSITORY:
181 
182  if($rbacsystem->checkAccess('edit_learning_progress',$this->getRefId()))
183  {
184  if($this->isAnonymized())
185  {
186  $this->ctrl->setParameterByClass('illplistofprogressgui','user_id',$this->getUserId());
187  $this->tabs_gui->addSubTabTarget('trac_progress',
188  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
189  "","","",$a_active == LP_ACTIVE_PROGRESS);
190  }
191  else
192  {
193  // Check if it is a course
194  $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) == 'crs') ?
195  'trac_crs_objects' :
196  'trac_objects';
197 
198  $this->tabs_gui->addSubTabTarget($sub_tab,
199  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
200  "","","",$a_active == LP_ACTIVE_OBJECTS);
201 
202  }
203 
204  if ($this->statistics_activated)
205  {
206  $this->tabs_gui->addSubTabTarget('trac_lm_statistics',
207  $this->ctrl->getLinkTargetByClass('illmstatisticsgui',''),
208  "","","",$a_active == LP_ACTIVE_LM_STATISTICS);
209  }
210 
211  if(!$this->isAnonymized() && !in_array($this->obj_type, array('tst', 'lm', 'htlm', 'exc')))
212  {
213  $this->tabs_gui->addSubTabTarget("trac_matrix",
214  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showUserObjectMatrix'),
215  "", "", "", $a_active == LP_ACTIVE_MATRIX);
216  }
217 
218  $this->tabs_gui->addSubTabTarget("trac_summary",
219  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showObjectSummary'),
220  "", "", "", $a_active == LP_ACTIVE_SUMMARY);
221 
222  $this->tabs_gui->addSubTabTarget('trac_settings',
223  $this->ctrl->getLinkTargetByClass('illplistofsettingsgui',''),
224  "","","",$a_active == LP_ACTIVE_SETTINGS);
225  }
226  break;
227 
229 
230  $this->tabs_gui->addSubTabTarget('trac_progress',
231  $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
232  "","","",$a_active == LP_ACTIVE_PROGRESS);
233  $this->tabs_gui->addSubTabTarget('trac_objects',
234  $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
235  "","","",$a_active == LP_ACTIVE_OBJECTS);
236  break;
237 
238  case LP_MODE_USER_FOLDER:
239 
240  // No tabs default class is lpprogressgui
241  break;
242 
243  default:
244  die ('No valid mode given');
245  break;
246  }
247 
248  return true;
249  }
250 
251  function __buildFooter()
252  {
253  switch($this->getMode())
254  {
256 
257  $this->tpl->show(true);
258  }
259  }
260 
261  function __buildHeader()
262  {
263  if($this->getMode() == LP_MODE_PERSONAL_DESKTOP)
264  {
265  $this->tpl->setCurrentBlock("header_image");
266  $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_pd_b.gif"));
267  $this->tpl->parseCurrentBlock();
268  $this->tpl->setVariable("HEADER",$this->lng->txt("personal_desktop"));
269 
270  // set locator
271 /*
272  $this->tpl->setVariable("TXT_LOCATOR", $this->lng->txt("locator"));
273  $this->tpl->touchBlock("locator_separator");
274  $this->tpl->touchBlock("locator_item");
275  //$this->tpl->setCurrentBlock("locator_item");
276  //$this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
277  //$this->tpl->setVariable("LINK_ITEM",
278  // $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui"));
279  //$this->tpl->parseCurrentBlock();
280 
281  $this->tpl->setCurrentBlock("locator_item");
282  $this->tpl->setVariable("ITEM", $this->lng->txt("learning_progress"));
283  $this->tpl->setVariable("LINK_ITEM",
284  $this->ctrl->getLinkTargetByClass('illearningprogressgui'));
285  $this->tpl->parseCurrentBlock();
286 */
287 
288  // display infopanel if something happened
290  }
291 
292  }
293 
297  function __insertPath(&$a_tpl,$a_ref_id)
298  {
299  global $tree;
300 
301  $path_arr = $tree->getPathFull($a_ref_id);
302  $counter = 0;
303  foreach($tree->getPathFull($a_ref_id) as $data)
304  {
305  if($counter++)
306  {
307  $path .= " -> ";
308  }
309  $path .= $data['title'];
310  }
311  $a_tpl->setCurrentBlock("path_item");
312  $a_tpl->setVariable("PATH_ITEM",$path);
313  $a_tpl->parseCurrentBlock();
314 
315  $a_tpl->setCurrentBlock("path");
316  $a_tpl->parseCurrentBlock();
317 
318  return $path;
319  }
320 
321  function __showImageByStatus(&$tpl,$a_status,$tpl_prefix = "")
322  {
323  return ilLearningProgressBaseGUI::_showImageByStatus($tpl,$a_status,$tpl_prefix);
324  }
325 
326  // we need this public in table classes
327  public static function _showImageByStatus(&$tpl,$a_status,$tpl_prefix = "")
328  {
329  global $lng;
330 
331  $tpl->setVariable($tpl_prefix."STATUS_IMG",
333  $tpl->setVariable($tpl_prefix."STATUS_ALT",$lng->txt($a_status));
334 
335  return true;
336  }
337 
341  function _getImagePathForStatus($a_status)
342  {
343  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
344 
345  // constants are either number or string, so make comparison string-based
346  switch((string)$a_status)
347  {
351  return ilUtil::getImagePath('scorm/incomplete.gif');
352  break;
353 
355  case LP_STATUS_COMPLETED:
357  return ilUtil::getImagePath('scorm/complete.gif');
358  break;
359 
363  return ilUtil::getImagePath('scorm/not_attempted.gif');
364  break;
365 
367  case LP_STATUS_FAILED:
368  return ilUtil::getImagePath('scorm/failed.gif');
369  break;
370 
371  default:
372  return ilUtil::getImagePath('scorm/not_attempted.gif');
373  break;
374  }
375  }
376 
380  function _getStatusText($a_status)
381  {
382  global $lng;
383 
384  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
385 //echo "#".$a_status."#";
386  switch($a_status)
387  {
389  return $lng->txt(LP_STATUS_IN_PROGRESS);
390 
392  return $lng->txt(LP_STATUS_COMPLETED);
393 
395  return $lng->txt(LP_STATUS_FAILED);
396 
397  default:
398  if ($a_status === LP_STATUS_NOT_ATTEMPTED_NUM)
399  {
400  return $lng->txt(LP_STATUS_NOT_ATTEMPTED);
401  }
402  return $lng->txt($a_status);
403  }
404  }
405 
406 
407  // Protected Table gui methods
408  function &__initTableGUI()
409  {
410  include_once "./Services/Table/classes/class.ilTableGUI.php";
411 
412  return new ilTableGUI(0,false);
413  }
414 
415 
419  function __showObjectDetails(&$info,$item_id = 0)
420  {
421  global $ilObjDataCache;
422 
423  $details_id = $item_id ? $item_id : $this->details_id;
424 
425  include_once './Services/MetaData/classes/class.ilMDEducational.php';
426  if(ilLPObjSettings::_lookupMode($details_id) == LP_MODE_VISITS ||
428  {
429 
430  // Section object details
431  $info->addSection($this->lng->txt('details'));
432 
433  /*
434  $info->addProperty($this->lng->txt('title'),$ilObjDataCache->lookupTitle($details_id));
435 
436  // :TODO: event title
437 
438  if(strlen($desc = $ilObjDataCache->lookupDescription($details_id)))
439  {
440  $info->addProperty($this->lng->txt('description'),$desc);
441  }
442  $info->addProperty($this->lng->txt('trac_mode'),ilLPObjSettings::_mode2Text(ilLPObjSettings::_lookupMode($details_id)));
443  */
444 
445  if(ilLPObjSettings::_lookupMode($details_id) == LP_MODE_VISITS)
446  {
447  $info->addProperty($this->lng->txt('trac_required_visits'),ilLPObjSettings::_lookupVisits($details_id));
448  }
449 
450  if($seconds = ilMDEducational::_getTypicalLearningTimeSeconds($details_id))
451  {
452  $info->addProperty($this->lng->txt('meta_typical_learning_time'),ilFormat::_secondsToString($seconds));
453  }
454 
455  return true;
456  }
457  return false;
458  }
459 
460  function __appendUserInfo(&$info, $a_user)
461  {
462  global $ilUser;
463 
464  if(!is_object($a_user))
465  {
466  $a_user = ilObjectFactory::getInstanceByObjId($a_user);
467  }
468 
469  if($a_user->getId() != $ilUser->getId())
470  {
471  $info->addSection($this->lng->txt("trac_user_data"));
472  // $info->addProperty($this->lng->txt('username'),$a_user->getLogin());
473  // $info->addProperty($this->lng->txt('name'),$a_user->getFullname());
474  $info->addProperty($this->lng->txt('last_login'),
475  ilDatePresentation::formatDate(new ilDateTime($a_user->getLastLogin(),IL_CAL_DATETIME)));
476  $info->addProperty($this->lng->txt('trac_total_online'),
478  return true;
479  }
480  }
481 
482  function __appendLPDetails(&$info,$item_id,$user_id)
483  {
484  global $ilObjDataCache;
485 
486  $type = $ilObjDataCache->lookupType($item_id);
487 
488  // Section learning_progress
489  $info->addSection($this->lng->txt('trac_learning_progress'));
490 
491  switch($type)
492  {
493  case 'lm':
494  case 'htlm':
495  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
496  $progress = ilLearningProgress::_getProgress($user_id,$item_id);
497 
498  if($progress['access_time'])
499  {
500  $info->addProperty($this->lng->txt('last_access'),
501  ilDatePresentation::formatDate(new ilDateTime($progress['access_time'],IL_CAL_DATETIME)));
502  }
503  else
504  {
505  $info->addProperty($this->lng->txt('last_access'),$this->lng->txt('trac_not_accessed'));
506  }
507  $info->addProperty($this->lng->txt('trac_visits'),(int) $progress['visits']);
508  if($type == 'lm')
509  {
510  $info->addProperty($this->lng->txt('trac_spent_time'),ilFormat::_secondsToString($progress['spent_seconds']));
511  }
512  $info->addProperty($this->lng->txt('trac_status'),$this->lng->txt($this->__readStatus($item_id,$user_id)));
513  break;
514 
515  case 'exc':
516  case 'tst':
517  case 'crs':
518  case 'sahs':
519  case 'grp':
520  $info->addProperty($this->lng->txt('trac_status'),$this->lng->txt($this->__readStatus($item_id,$user_id)));
521  break;
522 
523  }
524 
525  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
526  if(strlen($mark = ilLPMarks::_lookupMark($user_id,$item_id)))
527  {
528  $info->addProperty($this->lng->txt('trac_mark'),$mark);
529  }
530  if(strlen($comment = ilLPMarks::_lookupComment($user_id,$item_id)))
531  {
532  $info->addProperty($this->lng->txt('trac_comment'),$comment);
533  }
534  }
535 
536  function __readStatus($a_obj_id,$user_id)
537  {
538  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
539 
540  if(in_array($user_id,ilLPStatusWrapper::_getInProgress($a_obj_id)))
541  {
542  return $status = LP_STATUS_IN_PROGRESS;
543  }
544  elseif(in_array($user_id,ilLPStatusWrapper::_getCompleted($a_obj_id)))
545  {
546  return $status = LP_STATUS_COMPLETED;
547  }
548  elseif(in_array($user_id,ilLPStatusWrapper::_getFailed($a_obj_id)))
549  {
550  return $status = LP_STATUS_FAILED;
551  }
552  else
553  {
554  return $status = LP_STATUS_NOT_ATTEMPTED;
555  }
556  }
557 
558 
559  function __showButton($a_link,$a_text,$a_target = '')
560  {
561  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
562 
563  // display button
564  $this->tpl->setCurrentBlock("btn_cell");
565  $this->tpl->setVariable("BTN_LINK",$a_link);
566  $this->tpl->setVariable("BTN_TXT",$a_text);
567  if($a_target)
568  {
569  $this->tpl->setVariable("BTN_TARGET",$a_target);
570  }
571 
572  $this->tpl->parseCurrentBlock();
573  }
574 
575 
588  function __sort($a_ids,$a_table,$a_field,$a_id_name)
589  {
590  global $ilDB;
591 
592  if(!$a_ids)
593  {
594  return array();
595  }
596 
597  // comment by mjansen: Requesting database in gui classes?
598 
599  // use database to sort user array
600  $where = "WHERE ".$ilDB->in($a_id_name, $a_ids, false, 'integer')." ";
601 
602  $query = "SELECT ".$a_id_name." FROM ".$a_table." ".
603  $where.
604  "ORDER BY ".$a_field;
605 
606  $res = $ilDB->query($query);
607  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
608  {
609  $ids[] = $row->$a_id_name;
610  }
611  return $ids ? $ids : array();
612  }
613 
614  function __getPercent($max,$reached)
615  {
616  if(!$max)
617  {
618  return "0%";
619  }
620 
621  return sprintf("%d%%",$reached / $max * 100);
622  }
623 
624  function __readItemStatusInfo($a_items)
625  {
626  global $ilObjDataCache;
627 
628  foreach($a_items as $item_id)
629  {
630  $this->obj_data[$item_id]['mode'] = ilLPObjSettings::_lookupMode($item_id);
631  $this->obj_data[$item_id]['type'] = $ilObjDataCache->lookupType($item_id);
632  if($this->obj_data[$item_id]['mode'] == LP_MODE_TLT)
633  {
634  include_once './Services/MetaData/classes/class.ilMDEducational.php';
635  $this->obj_data[$item_id]['tlt'] = ilMDEducational::_getTypicalLearningTimeSeconds($item_id);
636  }
637  if($this->obj_data[$item_id]['mode'] == LP_MODE_VISITS)
638  {
639  include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
640  $this->obj_data[$item_id]['visits'] = ilLPObjSettings::_lookupVisits($item_id);
641  }
642  if($this->obj_data[$item_id]['mode'] == LP_MODE_SCORM)
643  {
644  include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
645  $this->obj_data[$item_id]['scos'] = count(ilLPCollectionCache::_getItems($item_id));
646  }
647  }
648  }
649 
650  function __getLegendHTML()
651  {
652  global $lng;
653 
654  $tpl = new ilTemplate("tpl.lp_legend.html", true, true, "Services/Tracking");
655  $tpl->setVariable("IMG_NOT_ATTEMPTED",
656  ilUtil::getImagePath("scorm/not_attempted.gif"));
657  $tpl->setVariable("IMG_IN_PROGRESS",
658  ilUtil::getImagePath("scorm/incomplete.gif"));
659  $tpl->setVariable("IMG_COMPLETED",
660  ilUtil::getImagePath("scorm/completed.gif"));
661  $tpl->setVariable("IMG_FAILED",
662  ilUtil::getImagePath("scorm/failed.gif"));
663  $tpl->setVariable("TXT_NOT_ATTEMPTED",
664  $lng->txt("trac_not_attempted"));
665  $tpl->setVariable("TXT_IN_PROGRESS",
666  $lng->txt("trac_in_progress"));
667  $tpl->setVariable("TXT_COMPLETED",
668  $lng->txt("trac_completed"));
669  $tpl->setVariable("TXT_FAILED",
670  $lng->txt("trac_failed"));
671  return $tpl->get();
672  }
673 
674  function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id = false)
675  {
676  global $ilObjDataCache, $lng, $ilCtrl;
677 
678  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
679 
680  if(!$a_sub_id)
681  {
682  $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
683  }
684  else
685  {
686  $ilCtrl->setParameter($this,'userdetails_id',$a_sub_id);
687  $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
688  }
689 
690  $marks = new ilLPMarks($obj_id, $a_user_id);
691 
692  $tpl = new ilTemplate('tpl.lp_edit_user.html', true, true, 'Services/Tracking');
693 
694  $tpl->setVariable("OBJ_TITLE", $lng->txt("edit").": ".$ilObjDataCache->lookupTitle($obj_id));
695  $tpl->setVariable("OBJ_SUBTITLE", $this->lng->txt('trac_mode').": ".ilLPObjSettings::_mode2Text(ilLPObjSettings::_lookupMode($obj_id)));
696 
697  $ilCtrl->setParameter($this,'user_id',$a_user_id);
698  $ilCtrl->setParameter($this,'details_id',$a_ref_id);
699  $tpl->setVariable("FORMACTION",$ilCtrl->getFormAction($this));
700 
701  $tpl->setVariable("TYPE_IMG",ilObjUser::_getPersonalPicturePath($a_user_id,'xxsmall'));
702  $tpl->setVariable("ALT_IMG",$ilObjDataCache->lookupTitle($a_user_id));
703  $tpl->setVariable("TXT_LP",$lng->txt('trac_learning_progress_tbl_header'));
704 
705  $tpl->setVariable("COMMENT",ilUtil::prepareFormOutput($marks->getComment(),false));
706 
707  $type = $ilObjDataCache->lookupType($obj_id);
708  if($type != 'lm')
709  {
710  $tpl->setVariable("TXT_MARK",$lng->txt('trac_mark'));
711  $tpl->setVariable("MARK",ilUtil::prepareFormOutput($marks->getMark(),false));
712  }
713 
714  $tpl->setVariable("TXT_COMMENT",$lng->txt('trac_comment'));
715 
718  {
719  $completed = ilLPStatusWrapper::_getCompleted($obj_id);
720 
721  $tpl->setVariable("mode_manual");
722  $tpl->setVariable("TXT_COMPLETED",$lng->txt('trac_completed'));
723  $tpl->setVariable("CHECK_COMPLETED",ilUtil::formCheckbox(in_array($a_user_id,$completed),
724  'completed',
725  '1'));
726  }
727 
728  $tpl->setVariable("TXT_CANCEL",$lng->txt('cancel'));
729  $tpl->setVariable("TXT_SAVE",$lng->txt('save'));
730  $tpl->setVariable("CMD_CANCEL", $a_cancel);
731 
732  return $tpl->get();
733  }
734 
735  function __updateUser($user_id, $obj_id)
736  {
737  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
738 
739  $marks = new ilLPMarks($obj_id, $user_id);
740  $marks->setMark(ilUtil::stripSlashes($_POST['mark']));
741  $marks->setComment(ilUtil::stripSlashes($_POST['comment']));
742  $marks->setCompleted((bool) $_POST['completed']);
743  $marks->update();
744 
745  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
746  ilLPStatusWrapper::_updateStatus($obj_id, $user_id);
747  }
748 }
749 
750 ?>