5include_once 
'./webservice/soap/classes/class.ilSoapAdministration.php';
 
   29        public function deleteProgress($sid, $ref_ids, $usr_ids, $type_filter, $progress_filter)
 
   35                if(!$this->__checkSession($sid))
 
   41                if(array_diff((array) $type_filter, self::$DELETE_PROGRESS_FILTER_TYPES))
 
   43                        return $this->
__raiseError(
'Invalid filter type given', 
'Client');
 
   46                include_once 
'Services/User/classes/class.ilObjUser.php';
 
   49                        return $this->
__raiseError(
'Invalid user ids given', 
'Client');
 
   52                $valid_refs = array();
 
   53                foreach((array) $ref_ids as 
$ref_id)
 
   59                        if(
$GLOBALS[
'objDefinition']->isContainer($type))
 
   61                                $all_sub_objs = array();
 
   62                                foreach(($type_filter) as $type_filter_item)
 
   64                                        $sub_objs = 
$GLOBALS[
'tree']->getSubTree(
 
   69                                        $all_sub_objs = array_merge($all_sub_objs, $sub_objs);
 
   72                                foreach($all_sub_objs as $child_ref)
 
   75                                        if(!
$GLOBALS[
'ilAccess']->checkAccess(
'write', 
'', $child_ref))
 
   77                                                return $this->
__raiseError(
'Permission denied for : '. $ref_id.
' -> type '.$type, 
'Client');
 
   79                                        $valid_refs[] = $child_ref;
 
   83                        elseif(in_array($type, $type_filter))
 
   87                                        return $this->
__raiseError(
'Permission denied for : '. $ref_id.
' -> type '.$type, 
'Client');
 
   93                                return $this->
__raiseError(
'Invalid object type given for : '. $ref_id.
' -> type '.$type, 
'Client');
 
  100                        include_once 
'./Services/Object/classes/class.ilObjectFactory.php';
 
  105                                return $this->
__raiseError(
'Invalid reference id given : '. $ref_id.
' -> type '.$type, 
'Client');
 
  109                        $valid_users = $this->
applyProgressFilter($obj->getId(), (array) $usr_ids, (array) $progress_filter);
 
  111                        switch($obj->getType())
 
  114                                        include_once 
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
 
  131                                        $obj->removeTestResultsByUserIds(array_values((array)$valid_users));
 
  136                        include_once 
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
 
  154                include_once 
'./Services/Tracking/classes/class.ilLPStatusWrapper.php';
 
  157                $all_users = array();
 
  158                if(in_array(self::USER_FILTER_ALL, $usr_ids))
 
  160                        $all_users = array_unique(
 
  170                        $all_users = $usr_ids;
 
  173                if(!$filter or in_array(self::PROGRESS_FILTER_ALL, $filter))
 
  175                        $GLOBALS[
'log']->write(__METHOD__.
': Deleting all progress data');
 
  179                $filter_users = array();
 
  180                if(in_array(self::PROGRESS_FILTER_IN_PROGRESS, $filter))
 
  182                        $GLOBALS[
'log']->write(__METHOD__.
': Filtering  in progress.');
 
  185                if(in_array(self::PROGRESS_FILTER_COMPLETED, $filter))
 
  187                        $GLOBALS[
'log']->write(__METHOD__.
': Filtering  completed.');
 
  190                if(in_array(self::PROGRESS_FILTER_FAILED, $filter))
 
  192                        $GLOBALS[
'log']->write(__METHOD__.
': Filtering  failed.');
 
  197                return array_intersect($all_users, $filter_users);
 
  211                $query = 
'DELETE FROM scorm_tracking '.
 
  212                        'WHERE '.$ilDB->in(
'user_id',$a_usr_ids,
false,
'integer').
' '.
 
  213                        'AND obj_id = '. 
$ilDB->quote($a_obj_id,
'integer').
' ';
 
  227                $query = 
'SELECT cp_node_id FROM cp_node '.
 
  228                        'WHERE nodename = '. 
$ilDB->quote(
'item',
'text').
' '.
 
  229                        'AND cp_node.slm_id = '.$ilDB->quote($a_obj_id,
'integer');
 
  235                        $scos[] = 
$row->cp_node_id;
 
  238                $query = 
'DELETE FROM cmi_node '.
 
  239                                'WHERE '.$ilDB->in(
'user_id',(array) $a_usr_ids,
false,
'integer').
' '.
 
  240                                'AND '.$ilDB->in(
'cp_node_id',$scos,
false,
'integer');
 
  253                if(!$this->__checkSession($sid))
 
  257                global $rbacsystem, $tree, 
$ilLog;
 
  261                if (is_array($type_filter))
 
  263                        $types = implode($type_filter, 
",");
 
  269                        include_once 
'./Services/Tracking/classes/class.ilLPXmlWriter.php';
 
  272                        $writer->setIncludeRefIds($include_ref_ids);
 
  273                        $writer->setTypeFilter($type_filter);
 
  276                        return $writer->xmlDumpMem(
true);
 
  278                catch(UnexpectedValueException $e)
 
foreach($mandatory_scripts as $file) $timestamp
const DB_FETCHMODE_OBJECT
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
_getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
_getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
static _resetInfoCaches($a_obj_id)
_getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
XML writer learning progress.
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static userExists($a_usr_ids=array())
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
__raiseError($a_message, $a_code)
This class handles all DB changes necessary for fraunhofer.
const PROGRESS_FILTER_IN_PROGRESS
const PROGRESS_FILTER_COMPLETED
deleteScorm2004Tracking($a_obj_id, $a_usr_ids)
Delete scorm 2004 tracking.
getLearningProgressChanges($sid, $timestamp, $include_ref_ids, $type_filter)
Get learning progress changes.
applyProgressFilter($obj_id, Array $usr_ids, Array $filter)
Apply progress filter.
const PROGRESS_FILTER_ALL
const PROGRESS_FILTER_FAILED
static $DELETE_PROGRESS_FILTER_TYPES
deleteScormTracking($a_obj_id, $a_usr_ids)
Delete SCORM Tracking @global type $ilDB.