ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSoapLearningProgressAdministration Class Reference

This class handles all DB changes necessary for fraunhofer. More...

+ Inheritance diagram for ilSoapLearningProgressAdministration:
+ Collaboration diagram for ilSoapLearningProgressAdministration:

Public Member Functions

 getLearningProgressChanges ($sid, $timestamp, $include_ref_ids, $type_filter)
 Get learning progress changes. More...
 
- Public Member Functions inherited from ilSoapAdministration
 __construct ($use_nusoap=true)
 Constructor. More...
 
 initErrorWriter ()
 Overwrite error handler. More...
 
 __explodeSid ($sid)
 
 __setMessage ($a_str)
 
 __getMessage ()
 
 __appendMessage ($a_str)
 
 __setMessageCode ($a_code)
 
 __getMessageCode ()
 
 initAuth ($sid)
 Init authentication. More...
 
 initIlias ()
 
 __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL)
 
 __raiseError ($a_message, $a_code)
 
 getNIC ($sid)
 get client information from current as xml result set More...
 
 isFault ($object)
 
 checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true More...
 
 getInstallationInfoXML ()
 
 getClientInfoXML ($clientid)
 

Data Fields

const PROGRESS_FILTER_ALL = 0
 
const PROGRESS_FILTER_IN_PROGRESS = 1
 
const PROGRESS_FILTER_COMPLETED = 2
 
const PROGRESS_FILTER_FAILED = 3
 
const PROGRESS_FILTER_NOT_ATTEMPTED = 4
 
const SOAP_LP_ERROR_AUTHENTICATION = 50
 
const SOAP_LP_ERROR_INVALID_FILTER = 52
 
const SOAP_LP_ERROR_INVALID_REF_ID = 54
 
const SOAP_LP_ERROR_LP_NOT_AVAILABLE = 56
 
const SOAP_LP_ERROR_NO_PERMISSION = 58
 
const SOAP_LP_ERROR_LP_NOT_ENABLED = 60
 
const USER_FILTER_ALL = -1
 
- Data Fields inherited from ilSoapAdministration
 $sauth = null
 
 $error_method = null
 

Protected Member Functions

 addUserProgress (ilXmlWriter $writer, $users, $a_type)
 
 applyProgressFilter ($obj_id, array $usr_ids, array $filter)
 Apply progress filter. More...
 
 deleteScormTracking ($a_obj_id, $a_usr_ids)
 Delete SCORM Tracking type $ilDB. More...
 
 deleteScorm2004Tracking ($a_obj_id, $a_usr_ids)
 Delete scorm 2004 tracking. More...
 

Static Protected Attributes

static $DELETE_PROGRESS_FILTER_TYPES = array('sahs', 'tst')
 
static $PROGRESS_INFO_TYPES
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSoapAdministration
static return_bytes ($val)
 calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes More...
 
- Protected Attributes inherited from ilSoapAdministration
 $soap_check = true
 

Detailed Description

This class handles all DB changes necessary for fraunhofer.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilSoapLearningProgressAdministration.php.

Member Function Documentation

◆ addUserProgress()

ilSoapLearningProgressAdministration::addUserProgress ( ilXmlWriter  $writer,
  $users,
  $a_type 
)
protected

Definition at line 349 of file class.ilSoapLearningProgressAdministration.php.

References $a_type, $info, $users, ilObjUser\_lookupName(), array, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

350  {
351  foreach ($users as $user_id) {
352  $writer->xmlStartTag(
353  'User',
354  array(
355  'id' => $user_id,
356  'status' => $a_type
357  )
358  );
359 
360  $info = ilObjUser::_lookupName($user_id);
361  $writer->xmlElement('Login', array(), (string) $info['login']);
362  $writer->xmlElement('Firstname', array(), (string) $info['firstname']);
363  $writer->xmlElement('Lastname', array(), (string) $info['lastname']);
364  $writer->xmlEndTag('User');
365  }
366  }
static _lookupName($a_user_id)
lookup user name
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
$a_type
Definition: workflow.php:92
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
$info
Definition: index.php:5
+ Here is the call graph for this function:

◆ applyProgressFilter()

ilSoapLearningProgressAdministration::applyProgressFilter (   $obj_id,
array  $usr_ids,
array  $filter 
)
protected

Apply progress filter.

Parameters
int$obj_id
array$usr_ids
array$filter
Returns
array $filtered_users

Definition at line 377 of file class.ilSoapLearningProgressAdministration.php.

References $GLOBALS, ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), and array.

378  {
379  include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
380 
381 
382  $all_users = array();
383  if (in_array(self::USER_FILTER_ALL, $usr_ids)) {
384  $all_users = array_unique(
385  array_merge(
389  )
390  );
391  } else {
392  $all_users = $usr_ids;
393  }
394 
395  if (!$filter or in_array(self::PROGRESS_FILTER_ALL, $filter)) {
396  $GLOBALS['log']->write(__METHOD__ . ': Deleting all progress data');
397  return $all_users;
398  }
399 
400  $filter_users = array();
401  if (in_array(self::PROGRESS_FILTER_IN_PROGRESS, $filter)) {
402  $GLOBALS['log']->write(__METHOD__ . ': Filtering in progress.');
403  $filter_users = array_merge($filter, ilLPStatusWrapper::_getInProgress($obj_id));
404  }
405  if (in_array(self::PROGRESS_FILTER_COMPLETED, $filter)) {
406  $GLOBALS['log']->write(__METHOD__ . ': Filtering completed.');
407  $filter_users = array_merge($filter, ilLPStatusWrapper::_getCompleted($obj_id));
408  }
409  if (in_array(self::PROGRESS_FILTER_FAILED, $filter)) {
410  $GLOBALS['log']->write(__METHOD__ . ': Filtering failed.');
411  $filter_users = array_merge($filter, ilLPStatusWrapper::_getFailed($obj_id));
412  }
413 
414  // Build intersection
415  return array_intersect($all_users, $filter_users);
416  }
static _getInProgress($a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getCompleted($a_obj_id)
Static function to read the users who have the status 'completed'.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ deleteScorm2004Tracking()

ilSoapLearningProgressAdministration::deleteScorm2004Tracking (   $a_obj_id,
  $a_usr_ids 
)
protected

Delete scorm 2004 tracking.

Parameters
type$a_obj_id
type$a_usr_ids

Definition at line 441 of file class.ilSoapLearningProgressAdministration.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

442  {
443  global $ilDB;
444 
445  $query = 'SELECT cp_node_id FROM cp_node ' .
446  'WHERE nodename = ' . $ilDB->quote('item', 'text') . ' ' .
447  'AND cp_node.slm_id = ' . $ilDB->quote($a_obj_id, 'integer');
448  $res = $ilDB->query($query);
449 
450  $scos = array();
451  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
452  $scos[] = $row->cp_node_id;
453  }
454 
455  $query = 'DELETE FROM cmi_node ' .
456  'WHERE ' . $ilDB->in('user_id', (array) $a_usr_ids, false, 'integer') . ' ' .
457  'AND ' . $ilDB->in('cp_node_id', $scos, false, 'integer');
458  $ilDB->manipulate($query);
459  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB

◆ deleteScormTracking()

ilSoapLearningProgressAdministration::deleteScormTracking (   $a_obj_id,
  $a_usr_ids 
)
protected

Delete SCORM Tracking type $ilDB.

Parameters
type$a_obj_id
type$a_usr_ids
Returns
boolean

Definition at line 425 of file class.ilSoapLearningProgressAdministration.php.

References $ilDB, $query, and $res.

426  {
427  global $ilDB;
428 
429  $query = 'DELETE FROM scorm_tracking ' .
430  'WHERE ' . $ilDB->in('user_id', $a_usr_ids, false, 'integer') . ' ' .
431  'AND obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ';
432  $res = $ilDB->manipulate($query);
433  return true;
434  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB

◆ getLearningProgressChanges()

ilSoapLearningProgressAdministration::getLearningProgressChanges (   $sid,
  $timestamp,
  $include_ref_ids,
  $type_filter 
)

Get learning progress changes.

Definition at line 464 of file class.ilSoapLearningProgressAdministration.php.

References $ilLog, $timestamp, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().

465  {
466  $this->initAuth($sid);
467  $this->initIlias();
468 
469  if (!$this->__checkSession($sid)) {
470  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
471  }
472  global $rbacsystem, $tree, $ilLog;
473 
474  // check administrator
475  $types = "";
476  if (is_array($type_filter)) {
477  $types = implode($type_filter, ",");
478  }
479 
480  // output lp changes as xml
481  try {
482  include_once './Services/Tracking/classes/class.ilLPXmlWriter.php';
483  $writer = new ilLPXmlWriter(true);
484  $writer->setTimestamp($timestamp);
485  $writer->setIncludeRefIds($include_ref_ids);
486  $writer->setTypeFilter($type_filter);
487  $writer->write();
488 
489  return $writer->xmlDumpMem(true);
490  } catch (UnexpectedValueException $e) {
491  return $this->__raiseError($e->getMessage(), 'Client');
492  }
493  }
XML writer learning progress.
__raiseError($a_message, $a_code)
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
initAuth($sid)
Init authentication.
+ Here is the call graph for this function:

Field Documentation

◆ $DELETE_PROGRESS_FILTER_TYPES

ilSoapLearningProgressAdministration::$DELETE_PROGRESS_FILTER_TYPES = array('sahs', 'tst')
staticprotected

◆ $PROGRESS_INFO_TYPES

ilSoapLearningProgressAdministration::$PROGRESS_INFO_TYPES
staticprotected
Initial value:
self::PROGRESS_FILTER_ALL,
self::PROGRESS_FILTER_IN_PROGRESS,
self::PROGRESS_FILTER_COMPLETED,
self::PROGRESS_FILTER_FAILED,
self::PROGRESS_FILTER_NOT_ATTEMPTED
)

Definition at line 31 of file class.ilSoapLearningProgressAdministration.php.

◆ PROGRESS_FILTER_ALL

const ilSoapLearningProgressAdministration::PROGRESS_FILTER_ALL = 0

◆ PROGRESS_FILTER_COMPLETED

const ilSoapLearningProgressAdministration::PROGRESS_FILTER_COMPLETED = 2

◆ PROGRESS_FILTER_FAILED

const ilSoapLearningProgressAdministration::PROGRESS_FILTER_FAILED = 3

◆ PROGRESS_FILTER_IN_PROGRESS

const ilSoapLearningProgressAdministration::PROGRESS_FILTER_IN_PROGRESS = 1

◆ PROGRESS_FILTER_NOT_ATTEMPTED

const ilSoapLearningProgressAdministration::PROGRESS_FILTER_NOT_ATTEMPTED = 4

◆ SOAP_LP_ERROR_AUTHENTICATION

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_AUTHENTICATION = 50

◆ SOAP_LP_ERROR_INVALID_FILTER

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_INVALID_FILTER = 52

◆ SOAP_LP_ERROR_INVALID_REF_ID

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_INVALID_REF_ID = 54

◆ SOAP_LP_ERROR_LP_NOT_AVAILABLE

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_LP_NOT_AVAILABLE = 56

◆ SOAP_LP_ERROR_LP_NOT_ENABLED

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_LP_NOT_ENABLED = 60

◆ SOAP_LP_ERROR_NO_PERMISSION

const ilSoapLearningProgressAdministration::SOAP_LP_ERROR_NO_PERMISSION = 58

◆ USER_FILTER_ALL

const ilSoapLearningProgressAdministration::USER_FILTER_ALL = -1

The documentation for this class was generated from the following file: