/**
  * Get all completed tests
  */
 protected function getItems()
 {
     global $ilUser, $tree;
     $data = array();
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     if (ilCertificate::isActive()) {
         $obj_ids = array();
         $root = $tree->getNodeData($tree->getRootId());
         foreach ($tree->getSubTree($root, true, "sahs") as $node) {
             $obj_ids[] = $node["obj_id"];
         }
         if ($obj_ids) {
             include_once "./Services/Tracking/classes/class.ilObjUserTracking.php";
             include_once "./Services/Tracking/classes/class.ilLPStatus.php";
             include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
             include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
             include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
             include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
             $lp_active = ilObjUserTracking::_enabledLearningProgress();
             foreach (ilCertificate::areObjectsActive($obj_ids) as $obj_id => $active) {
                 if ($active) {
                     $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
                     if ($type == "scorm") {
                         $lm = new ilObjSCORMLearningModule($obj_id, false);
                     } else {
                         $lm = new ilObjSCORM2004LearningModule($obj_id, false);
                     }
                     $adapter = new ilSCORMCertificateAdapter($lm);
                     if (ilCertificate::_isComplete($adapter)) {
                         $lpdata = $completed = false;
                         if ($lp_active) {
                             $completed = ilLPStatus::_hasUserCompleted($obj_id, $ilUser->getId());
                             $lpdata = true;
                         }
                         if (!$lpdata) {
                             switch ($type) {
                                 case "scorm":
                                     $completed = ilObjSCORMLearningModule::_getCourseCompletionForUser($obj_id, $ilUser->getId());
                                     break;
                                 case "scorm2004":
                                     $completed = ilObjSCORM2004LearningModule::_getCourseCompletionForUser($obj_id, $ilUser->getId());
                                     break;
                             }
                         }
                         $data[] = array("id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "passed" => (bool) $completed);
                     }
                 }
             }
         }
     }
     $this->setData($data);
 }
    /**
     * delete SCORM learning module and all related data	
     *
     * this method has been tested on may 9th 2004
     * meta data, scorm lm data, scorm tree, scorm objects (organization(s),
     * manifest, resources and items), tracking data and data directory
     * have been deleted correctly as desired
     *
     * @access	public
     * @return	boolean	true if all object data were removed; false if only a references were removed
     */
    function delete()
    {
        global $ilDB, $ilLog;
        // always call parent delete function first!!
        if (!parent::delete()) {
            return false;
        }
        // delete meta data of scorm content object
        /*
        		$nested = new ilNestedSetXML();
        		$nested->init($this->getId(), $this->getType());
        		$nested->deleteAllDBData();
        */
        $this->deleteMetaData();
        // delete data directory
        ilUtil::delDir($this->getDataDirectory());
        // delete scorm learning module record
        $ilDB->manipulateF('DELETE FROM sahs_lm WHERE id = %s', array('integer'), array($this->getId()));
        // delete aicc data
        $res = $ilDB->queryF('
			SELECT * FROM aicc_object, aicc_units
			WHERE aicc_object.obj_id = aicc_units.obj_id
			AND aicc_object.slm_id = %s', array('integer'), array($this->getId()));
        while ($row = $ilDB->fetchAssoc($res)) {
            $obj_id = $row['obj_id'];
            $ilDB->manipulateF('
					DELETE FROM aicc_units WHERE obj_id = %s', array('integer'), array($obj_id));
        }
        $res = $ilDB->queryF('
			SELECT * FROM aicc_object, aicc_course
			WHERE aicc_object.obj_id = aicc_course.obj_id
			AND aicc_object.slm_id = %s', array('integer'), array($this->getId()));
        while ($row = $ilDB->fetchAssoc($res)) {
            $obj_id = $row['obj_id'];
            $ilDB->manipulateF('
				DELETE FROM aicc_course WHERE obj_id = %s', array('integer'), array($obj_id));
        }
        $ilDB->manipulateF('DELETE FROM scorm_tree WHERE slm_id = %s', array('integer'), array($this->getId()));
        $ilDB->manipulateF('DELETE FROM aicc_object WHERE slm_id = %s', array('integer'), array($this->getId()));
        $q_log = "DELETE FROM scorm_tracking WHERE obj_id = " . $ilDB->quote($this->getId());
        $ilLog->write("SAHS Delete (AICC LM): " . $q_log);
        $ilDB->manipulateF('DELETE FROM scorm_tracking WHERE obj_id = %s', array('integer'), array($this->getId()));
        $q_log = "DELETE FROM sahs_user WHERE obj_id = " . $ilDB->quote($this->getId());
        $ilLog->write("SAHS Delete (AICC LM): " . $q_log);
        $ilDB->manipulateF('DELETE FROM sahs_user WHERE obj_id = %s', array('integer'), array($this->getId()));
        // update learning progress status
        include_once "./Services/Tracking/classes/class.ilLPStatusWrapper.php";
        ilLPStatusWrapper::_refreshStatus($this->getId());
        // always call parent delete function at the end!!
        return true;
    }
 public function getScoresForUserAndCP_Node_Id($item_id, $user_id)
 {
     include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
     switch (ilObjSAHSLearningModule::_lookupSubType($this->obj_id)) {
         case 'hacp':
         case 'aicc':
             include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
             return ilObjAICCLearningModule::_getScoresForUser($item_id, $user_id);
         case 'scorm':
             include_once './Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
             //include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
             return ilObjSCORMLearningModule::_getScoresForUser($item_id, $user_id);
         case 'scorm2004':
             include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
             return ilObjSCORM2004LearningModule::_getScores2004ForUser($item_id, $user_id);
     }
     return array("raw" => null, "max" => null, "scaled" => null);
 }
 /**
  * Import relevant properties from given learning module
  *
  * @param ilObjSAHSLearningModule $a_lm
  * @return object
  */
 public static function createFromSCORMLM(ilObjSAHSLearningModule $a_lm, $a_user_id)
 {
     global $lng;
     $lng->loadLanguageModule("sahs");
     $newObj = new self();
     $newObj->setTitle($a_lm->getTitle());
     $newObj->setDescription($a_lm->getDescription());
     include_once "Services/Tracking/classes/class.ilLPMarks.php";
     $lp_marks = new ilLPMarks($a_lm->getId(), $a_user_id);
     $newObj->setProperty("issued_on", new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
     // create certificate
     if (!stristr(get_class($a_lm), "2004")) {
         $last_access = ilObjSCORMLearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
     } else {
         $last_access = ilObjSCORM2004LearningModule::_lookupLastAccess($a_lm->getId(), $a_user_id);
     }
     $params = array("user_data" => ilObjUser::_lookupFields($a_user_id), "last_access" => $last_access);
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     include_once "Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
     $certificate = new ilCertificate(new ilSCORMCertificateAdapter($a_lm));
     $certificate = $certificate->outCertificate($params, false);
     // save pdf file
     if ($certificate) {
         // we need the object id for storing the certificate file
         $newObj->create();
         $path = self::initStorage($newObj->getId(), "certificate");
         $file_name = "sahs_" . $a_lm->getId() . "_" . $a_user_id . ".pdf";
         if (file_put_contents($path . $file_name, $certificate)) {
             $newObj->setProperty("file", $file_name);
             $newObj->update();
             return $newObj;
         }
         // file creation failed, so remove to object, too
         $newObj->delete();
     }
 }
 /**
  * Get the completion of a SCORM module for a given user
  * @param int $a_id Object id
  * @param int $a_user User id
  * @return boolean Completion status
  */
 public static function _getCourseCompletionForUser($a_id, $a_user)
 {
     return ilObjSCORMLearningModule::_getStatusForUser($a_id, $a_user, ilObjSCORMLearningModule::_getAllScoIds($a_id), true);
 }
 /**
  * Get all object-based tracking data for user and parent object
  *
  * @param	int		$a_user_id
  * @param	int		$a_parent_obj_id
  * @param	int		$a_parent_ref_id
  * @param	string	$a_order_field
  * @param	string	$a_order_dir
  * @param	int		$a_offset
  * @param	int		$a_limit
  * @param	array	$a_filters
  * @param	array	$a_additional_fields
  * @param	bool	$use_collection
  * @return	array	cnt, set
  */
 static function getObjectsDataForUser($a_user_id, $a_parent_obj_id, $a_parent_ref_id, $a_order_field = "", $a_order_dir = "", $a_offset = 0, $a_limit = 9999, array $a_filters = NULL, array $a_additional_fields = NULL, $use_collection = true)
 {
     global $ilDB;
     $fields = array("object_data.obj_id", "title", "type");
     self::buildColumns($fields, $a_additional_fields);
     $objects = self::getObjectIds($a_parent_obj_id, $a_parent_ref_id, $use_collection, true, array($a_user_id));
     $query = " FROM object_data LEFT JOIN read_event ON (object_data.obj_id = read_event.obj_id AND" . " read_event.usr_id = " . $ilDB->quote($a_user_id, "integer") . ")" . " LEFT JOIN ut_lp_marks ON (ut_lp_marks.usr_id = " . $ilDB->quote($a_user_id, "integer") . " AND" . " ut_lp_marks.obj_id = object_data.obj_id)" . " WHERE " . $ilDB->in("object_data.obj_id", $objects["object_ids"], false, "integer") . self::buildFilters(array(), $a_filters);
     $queries = array();
     $queries[] = array("fields" => $fields, "query" => $query);
     // objectives data
     if ($objects["objectives_parent_id"]) {
         $objective_fields = array("crs_objectives.objective_id AS obj_id", "title", $ilDB->quote("lobj", "text") . " as type");
         if (is_array($a_additional_fields)) {
             foreach ($a_additional_fields as $field) {
                 if ($field != "status") {
                     $objective_fields[] = "NULL AS " . $field;
                 } else {
                     include_once "Services/Tracking/classes/class.ilLPStatus.php";
                     $objective_fields[] = "CASE WHEN status IS NOT NULL THEN " . LP_STATUS_COMPLETED_NUM . " ELSE NULL END AS status";
                 }
             }
         }
         $where = array();
         $where[] = "crs_objectives.crs_id = " . $ilDB->quote($objects["objectives_parent_id"], "integer");
         $objectives_query = " FROM crs_objectives" . " LEFT JOIN crs_objective_status ON (crs_objectives.objective_id = crs_objective_status.objective_id" . " AND crs_objective_status.user_id = " . $ilDB->quote($a_user_id, "integer") . ")" . self::buildFilters($where, $a_filters);
         $queries[] = array("fields" => $objective_fields, "query" => $objectives_query, "count" => "crs_objectives.objective_id");
     }
     if (!in_array($a_order_field, $fields)) {
         $a_order_field = "title";
     }
     $result = self::executeQueries($queries, $a_order_field, $a_order_dir, $a_offset, $a_limit);
     if ($result["cnt"]) {
         // session data
         $sessions = self::getSessionData($a_user_id, $objects["object_ids"]);
         foreach ($result["set"] as $idx => $item) {
             if ($item["type"] == "sess") {
                 $session = $sessions[$item["obj_id"]];
                 $result["set"][$idx]["title"] = $session["title"];
                 $result["set"][$idx]["sort_title"] = $session["e_start"];
                 // $result["set"][$idx]["status"] = (int)$session["status"];
             }
             $result["set"][$idx]["ref_id"] = $objects["ref_ids"][$item["obj_id"]];
         }
         // scos data (:TODO: will not be part of offset/limit)
         if ($objects["scorm"]) {
             include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
             $subtype = ilObjSAHSLearningModule::_lookupSubType($a_parent_obj_id);
             if ($subtype == "scorm2004") {
                 include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
                 $sobj = new ilObjSCORM2004LearningModule($a_parent_ref_id, true);
                 $scos_tracking = $sobj->getTrackingDataAgg($a_user_id, true);
             } else {
                 include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
                 $sobj = new ilObjSCORMLearningModule($a_parent_ref_id, true);
                 $scos_tracking = array();
                 foreach ($sobj->getTrackingDataAgg($a_user_id) as $item) {
                     // format: hhhh:mm:ss ?!
                     if ($item["time"]) {
                         $time = explode(":", $item["time"]);
                         $item["time"] = $time[0] * 60 * 60 + $time[1] * 60 + $time[2];
                     }
                     $scos_tracking[$item["sco_id"]] = array("session_time" => $item["time"]);
                 }
             }
             foreach ($objects["scorm"]["scos"] as $sco) {
                 $row = array("title" => $objects["scorm"]["scos_title"][$sco], "type" => "sco");
                 $status = LP_STATUS_NOT_ATTEMPTED_NUM;
                 if (in_array($a_user_id, $objects["scorm"]["completed"][$sco])) {
                     $status = LP_STATUS_COMPLETED_NUM;
                 } else {
                     if (in_array($a_user_id, $objects["scorm"]["failed"][$sco])) {
                         $status = LP_STATUS_FAILED_NUM;
                     } else {
                         if (in_array($a_user_id, $objects["scorm"]["in_progress"][$sco])) {
                             $status = LP_STATUS_IN_PROGRESS_NUM;
                         }
                     }
                 }
                 $row["status"] = $status;
                 // add available tracking data
                 if (isset($scos_tracking[$sco])) {
                     if (isset($scos_tracking[$sco]["last_access"])) {
                         $date = new ilDateTime($scos_tracking[$sco]["last_access"], IL_CAL_DATETIME);
                         $row["last_access"] = $date->get(IL_CAL_UNIX);
                     }
                     $row["spent_seconds"] = $scos_tracking[$sco]["session_time"];
                 }
                 $result["set"][] = $row;
                 $result["cnt"]++;
             }
         }
     }
     return $result;
 }
 /**
  * Clone scorm object
  *
  * @param int target ref_id
  * @param int copy id
  */
 public function cloneObject($a_target_id, $a_copy_id = 0)
 {
     global $ilDB, $ilUser, $ilias;
     $new_obj = parent::cloneObject($a_target_id, $a_copy_id);
     $this->cloneMetaData($new_obj);
     // copy properties
     $new_obj->setTitle($this->getTitle());
     $new_obj->setDescription($this->getDescription());
     $new_obj->setSubType($this->getSubType());
     $new_obj->setAPIAdapterName($this->getAPIAdapterName());
     $new_obj->setAPIFunctionsPrefix($this->getAPIFunctionsPrefix());
     $new_obj->setAutoReviewChar($this->getAutoReviewChar());
     $new_obj->setDefaultLessonMode($this->getDefaultLessonMode());
     $new_obj->setEditable($this->getEditable());
     $new_obj->setMaxAttempt($this->getMaxAttempt());
     //		$new_obj->getModuleVersion($this->getModuleVersion());	??
     $new_obj->setModuleVersion(1);
     $new_obj->setCreditMode($this->getCreditMode());
     $new_obj->setAssignedGlossary($this->getAssignedGlossary());
     $new_obj->setTries($this->getTries());
     $new_obj->setSession($this->getSession());
     $new_obj->setNoMenu($this->getNoMenu());
     $new_obj->setHideNavig($this->getHideNavig());
     $new_obj->setSequencing($this->getSequencing());
     $new_obj->setInteractions($this->getInteractions());
     $new_obj->setObjectives($this->getObjectives());
     $new_obj->setComments($this->getComments());
     $new_obj->setTime_from_lms($this->getTime_from_lms());
     $new_obj->setDebug($this->getDebug());
     $new_obj->setLocalization($this->getLocalization());
     $new_obj->setSequencingExpertMode($this->getSequencingExpertMode());
     $new_obj->setDebugPw($this->getDebugPw());
     $new_obj->setOpenMode($this->getOpenMode());
     $new_obj->setWidth($this->getWidth());
     $new_obj->setHeight($this->getHeight());
     $new_obj->setAutoContinue($this->getAutoContinue());
     $new_obj->setAuto_last_visited($this->getAuto_last_visited());
     $new_obj->setCheck_values($this->getCheck_values());
     $new_obj->setOfflineMode($this->getOfflineMode());
     $new_obj->setAutoSuspend($this->getAutoSuspend());
     $new_obj->update();
     // set/copy stylesheet
     /*		include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
     		$style_id = $this->getStyleSheetId();
     		if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
     		{
     			$style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
     			$new_id = $style_obj->ilClone();
     			$new_obj->setStyleSheetId($new_id);
     			$new_obj->update();
     		}*/
     // up to this point $new_obj is of type ilobjsahslearning module
     // create instance of correct subtype and call forward it to
     // cloneIntoNewObject method
     switch ($this->getSubType()) {
         case "scorm":
             include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
             $source_obj = new ilObjSCORMLearningModule($this->getRefId());
             $new_obj = new ilObjSCORMLearningModule($new_obj->getRefId());
             break;
         case "scorm2004":
             include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
             $source_obj = new ilObjSCORM2004LearningModule($this->getRefId());
             $new_obj = new ilObjSCORM2004LearningModule($new_obj->getRefId());
             break;
         case "aicc":
             include_once "./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php";
             $source_obj = new ilObjAICCLearningModule($this->getRefId());
             $new_obj = new ilObjAICCLearningModule($new_obj->getRefId());
             break;
         case "hacp":
             include_once "./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php";
             $source_obj = new ilObjHACPLearningModule($this->getRefId());
             $new_obj = new ilObjHACPLearningModule($new_obj->getRefId());
             break;
     }
     // copy data directory
     $new_obj->populateByDirectoy($source_obj->getDataDirectory());
     // copy authored content ...
     if ($new_obj->getEditable()) {
         $source_obj->copyAuthoredContent($new_obj);
     } else {
         // ... or read manifest file
         $new_obj->readObject();
     }
     return $new_obj;
 }
 /**
  * Download the certificate for the active user
  */
 public function downloadCertificate()
 {
     global $ilUser, $tree, $ilCtrl;
     $allowed = false;
     $last_access = 0;
     $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
     include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
     if (ilObjSAHSLearningModuleAccess::_lookupUserCertificate($obj_id)) {
         include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
         $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
         switch ($type) {
             case "scorm":
                 include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
                 $allowed = true;
                 $last_access = ilObjSCORMLearningModule::_lookupLastAccess($obj_id, $ilUser->getId());
                 break;
             case "scorm2004":
                 include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
                 $allowed = true;
                 $last_access = ilObjSCORM2004LearningModule::_lookupLastAccess($obj_id, $ilUser->getId());
                 break;
             default:
                 break;
         }
     }
     if ($allowed) {
         include_once "./Services/Certificate/classes/class.ilCertificate.php";
         include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
         $certificate = new ilCertificate(new ilSCORMCertificateAdapter($this->slm));
         $params = array("user_data" => ilObjUser::_lookupFields($ilUser->getId()), "last_access" => $last_access);
         $certificate->outCertificate($params, true);
         exit;
     }
     // redirect to parent category if certificate is not accessible
     $parent = $tree->getParentId($_GET["ref_id"]);
     $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent);
     $ilCtrl->redirectByClass("ilrepositorygui", "");
 }
 /**
  * Checks whether a certificate exists for the active user or not
  * @param int obj_id Object ID of the SCORM Learning Module
  * @param int usr_id Object ID of the user. If not given, the active user will be taken
  * @return true/false
  */
 public static function _lookupUserCertificate($obj_id, $usr_id = 0)
 {
     global $ilUser;
     $uid = $usr_id ? $usr_id : $ilUser->getId();
     $completed = false;
     // check for certificates
     include_once "./Services/Certificate/classes/class.ilCertificate.php";
     if (ilCertificate::isActive() && ilCertificate::isObjectActive($obj_id)) {
         $lpdata = false;
         include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
         $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
         include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
         if (ilObjUserTracking::_enabledLearningProgress()) {
             include_once "./Services/Tracking/classes/class.ilLPStatus.php";
             $completed = ilLPStatus::_hasUserCompleted($obj_id, $uid);
             $lpdata = true;
         }
         switch ($type) {
             case "scorm":
                 if (!$lpdata) {
                     include_once "./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php";
                     $completed = ilObjSCORMLearningModule::_getCourseCompletionForUser($obj_id, $uid);
                 }
                 break;
             case "scorm2004":
                 if (!$lpdata) {
                     include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php";
                     $completed = ilObjSCORM2004LearningModule::_getCourseCompletionForUser($obj_id, $uid);
                 }
                 break;
             default:
                 break;
         }
     }
     return $completed;
 }
 /**
  * Constructor
  * @access	public
  * @param	integer	reference_id or object_id
  * @param	boolean	treat the id as reference_id (true) or object_id (false)
  */
 function ilObjSCORM2004LearningModule($a_id = 0, $a_call_by_reference = true)
 {
     $this->type = "sahs";
     parent::ilObject($a_id, $a_call_by_reference);
 }
Exemplo n.º 11
0
 /**
  * deletes a user
  * @access	public
  * @param	integer		user_id
  */
 function delete()
 {
     global $rbacadmin, $ilDB;
     // deassign from ldap groups
     include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php';
     $mapping = ilLDAPRoleGroupMapping::_getInstance();
     $mapping->deleteUser($this->getId());
     // remove mailbox / update sent mails
     include_once "Services/Mail/classes/class.ilMailbox.php";
     $mailbox = new ilMailbox($this->getId());
     $mailbox->delete();
     $mailbox->updateMailsOfDeletedUser($this->getLogin());
     // delete feed blocks on personal desktop
     include_once "./Services/Block/classes/class.ilCustomBlock.php";
     $costum_block = new ilCustomBlock();
     $costum_block->setContextObjId($this->getId());
     $costum_block->setContextObjType("user");
     $c_blocks = $costum_block->queryBlocksForContext();
     include_once "./Services/Feeds/classes/class.ilPDExternalFeedBlock.php";
     foreach ($c_blocks as $c_block) {
         if ($c_block["type"] == "pdfeed") {
             $fb = new ilPDExternalFeedBlock($c_block["id"]);
             $fb->delete();
         }
     }
     // delete block settings
     include_once "./Services/Block/classes/class.ilBlockSetting.php";
     ilBlockSetting::_deleteSettingsOfUser($this->getId());
     // delete user_account
     $ilDB->manipulateF("DELETE FROM usr_data WHERE usr_id = %s", array("integer"), array($this->getId()));
     // delete user_prefs
     ilObjUser::_deleteAllPref($this->getId());
     // delete user_session
     include_once "./Services/Authentication/classes/class.ilSession.php";
     ilSession::_destroyByUserId($this->getId());
     // remove user from rbac
     $rbacadmin->removeUser($this->getId());
     // remove bookmarks
     // TODO: move this to class.ilBookmarkFolder
     $q = "DELETE FROM bookmark_tree WHERE tree = " . $ilDB->quote($this->getId(), "integer");
     $ilDB->manipulate($q);
     $q = "DELETE FROM bookmark_data WHERE user_id = " . $ilDB->quote($this->getId(), "integer");
     $ilDB->manipulate($q);
     // DELETE FORUM ENTRIES (not complete in the moment)
     include_once './Modules/Forum/classes/class.ilObjForum.php';
     ilObjForum::_deleteUser($this->getId());
     // Delete link check notify entries
     include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
     ilLinkCheckNotify::_deleteUser($this->getId());
     // Delete crs entries
     include_once './Modules/Course/classes/class.ilObjCourse.php';
     ilObjCourse::_deleteUser($this->getId());
     // Delete user tracking
     include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
     ilObjUserTracking::_deleteUser($this->getId());
     include_once 'Modules/Session/classes/class.ilEventParticipants.php';
     ilEventParticipants::_deleteByUser($this->getId());
     // Delete Tracking data SCORM 2004 RTE
     include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php';
     ilSCORM13Package::_removeTrackingDataForUser($this->getId());
     // Delete Tracking data SCORM 1.2 RTE
     include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
     ilObjSCORMLearningModule::_removeTrackingDataForUser($this->getId());
     // remove all notifications
     include_once "./Services/Notification/classes/class.ilNotification.php";
     ilNotification::removeForUser($this->getId());
     // remove portfolios
     include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php";
     ilObjPortfolio::deleteUserPortfolios($this->getId());
     // remove workspace
     include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
     $tree = new ilWorkspaceTree($this->getId());
     $tree->cascadingDelete();
     // remove disk quota entries
     include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
     ilDiskQuotaHandler::deleteByOwner($this->getId());
     // Delete user defined field entries
     $this->deleteUserDefinedFieldEntries();
     // Delete clipboard entries
     $this->clipboardDeleteAll();
     // Reset owner
     $this->resetOwner();
     // Trigger deleteUser Event
     global $ilAppEventHandler;
     $ilAppEventHandler->raise('Services/User', 'deleteUser', array('usr_id' => $this->getId()));
     // delete object data
     parent::delete();
     return true;
 }