ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 358 of file class.ilSoapLearningProgressAdministration.php.

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

359  {
360  foreach ($users as $user_id) {
361  $writer->xmlStartTag(
362  'User',
363  array(
364  'id' => $user_id,
365  'status' => $a_type
366  )
367  );
368 
369  $info = ilObjUser::_lookupName($user_id);
370  $writer->xmlElement('Login', array(), (string) $info['login']);
371  $writer->xmlElement('Firstname', array(), (string) $info['firstname']);
372  $writer->xmlElement('Lastname', array(), (string) $info['lastname']);
373  $writer->xmlEndTag('User');
374  }
375  }
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
$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 386 of file class.ilSoapLearningProgressAdministration.php.

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

387  {
388  include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
389 
390 
391  $all_users = array();
392  if (in_array(self::USER_FILTER_ALL, $usr_ids)) {
393  $all_users = array_unique(
394  array_merge(
398  )
399  );
400  } else {
401  $all_users = $usr_ids;
402  }
403 
404  if (!$filter or in_array(self::PROGRESS_FILTER_ALL, $filter)) {
405  $GLOBALS['DIC']['log']->write(__METHOD__ . ': Deleting all progress data');
406  return $all_users;
407  }
408 
409  $filter_users = array();
410  if (in_array(self::PROGRESS_FILTER_IN_PROGRESS, $filter)) {
411  $GLOBALS['DIC']['log']->write(__METHOD__ . ': Filtering in progress.');
412  $filter_users = array_merge($filter, ilLPStatusWrapper::_getInProgress($obj_id));
413  }
414  if (in_array(self::PROGRESS_FILTER_COMPLETED, $filter)) {
415  $GLOBALS['DIC']['log']->write(__METHOD__ . ': Filtering completed.');
416  $filter_users = array_merge($filter, ilLPStatusWrapper::_getCompleted($obj_id));
417  }
418  if (in_array(self::PROGRESS_FILTER_FAILED, $filter)) {
419  $GLOBALS['DIC']['log']->write(__METHOD__ . ': Filtering failed.');
420  $filter_users = array_merge($filter, ilLPStatusWrapper::_getFailed($obj_id));
421  }
422 
423  // Build intersection
424  return array_intersect($all_users, $filter_users);
425  }
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'.
static _getFailed($a_obj_id)
Static function to read the users who have the status 'completed'.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 452 of file class.ilSoapLearningProgressAdministration.php.

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

453  {
454  global $DIC;
455 
456  $ilDB = $DIC['ilDB'];
457 
458  $query = 'SELECT cp_node_id FROM cp_node ' .
459  'WHERE nodename = ' . $ilDB->quote('item', 'text') . ' ' .
460  'AND cp_node.slm_id = ' . $ilDB->quote($a_obj_id, 'integer');
461  $res = $ilDB->query($query);
462 
463  $scos = array();
464  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
465  $scos[] = $row->cp_node_id;
466  }
467 
468  $query = 'DELETE FROM cmi_node ' .
469  'WHERE ' . $ilDB->in('user_id', (array) $a_usr_ids, false, 'integer') . ' ' .
470  'AND ' . $ilDB->in('cp_node_id', $scos, false, 'integer');
471  $ilDB->manipulate($query);
472  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 434 of file class.ilSoapLearningProgressAdministration.php.

References $DIC, $ilDB, $query, and $res.

435  {
436  global $DIC;
437 
438  $ilDB = $DIC['ilDB'];
439 
440  $query = 'DELETE FROM scorm_tracking ' .
441  'WHERE ' . $ilDB->in('user_id', $a_usr_ids, false, 'integer') . ' ' .
442  'AND obj_id = ' . $ilDB->quote($a_obj_id, 'integer') . ' ';
443  $res = $ilDB->manipulate($query);
444  return true;
445  }
global $DIC
Definition: saml.php:7
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 477 of file class.ilSoapLearningProgressAdministration.php.

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

478  {
479  $this->initAuth($sid);
480  $this->initIlias();
481 
482  if (!$this->__checkSession($sid)) {
483  return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
484  }
485  global $DIC;
486 
487  $rbacsystem = $DIC['rbacsystem'];
488  $tree = $DIC['tree'];
489  $ilLog = $DIC['ilLog'];
490 
491  // check administrator
492  $types = "";
493  if (is_array($type_filter)) {
494  $types = implode(",", $type_filter);
495  }
496 
497  // output lp changes as xml
498  try {
499  include_once './Services/Tracking/classes/class.ilLPXmlWriter.php';
500  $writer = new ilLPXmlWriter(true);
501  $writer->setTimestamp($timestamp);
502  $writer->setIncludeRefIds($include_ref_ids);
503  $writer->setTypeFilter($type_filter);
504  $writer->write();
505 
506  return $writer->xmlDumpMem(true);
507  } catch (UnexpectedValueException $e) {
508  return $this->__raiseError($e->getMessage(), 'Client');
509  }
510  }
global $DIC
Definition: saml.php:7
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:
= array(
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: