ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestLP Class Reference
+ Inheritance diagram for ilTestLP:
+ Collaboration diagram for ilTestLP:

Public Member Functions

 getDefaultMode ()
 
 getValidModes ()
 
 isAnonymized ()
 
 setTestObject (\ilObjTest $test)
 
- Public Member Functions inherited from ilObjectLP
 resetCaches ()
 
 isAnonymized ()
 
 getDefaultMode ()
 
 getValidModes ()
 
 getCurrentMode ()
 
 isActive ()
 
 getModeText ($a_mode)
 
 getModeInfoText ($a_mode)
 
 getSettingsInfo ()
 
 getCollectionInstance ()
 
 getMembers ($a_search=true)
 
 resetLPDataForCompleteObject ($a_recursive=true)
 
 resetLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 handleToTrash ()
 
 handleDelete ()
 
 getMailTemplateId ()
 

Static Public Member Functions

static getDefaultModes ($a_lp_active)
 
- Static Public Member Functions inherited from ilObjectLP
static getInstance ($a_obj_id)
 
static getTypeClass ($a_type)
 
static isSupportedObjectType ($a_type)
 
static handleMove ($a_source_ref_id)
 
static getLPMemberships ($a_usr_id, array $a_obj_ids, $a_parent_ref_id=null, $a_mapped_ref_ids=false)
 Get all objects where given user is member (from LP POV) More...
 
static supportsSpentSeconds ($a_obj_type)
 
static supportsMark ($a_obj_type)
 
static supportsMatrixView ($a_obj_type)
 
static getDefaultModes ($a_lp_active)
 Get available type-specific default modes (no administration needed) More...
 
static saveTypeDefaults (array $a_data)
 
static getTypeDefault ($a_type)
 Get current type default. More...
 

Protected Member Functions

 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
- Protected Member Functions inherited from ilObjectLP
 __construct ($a_obj_id)
 
 resetCustomLPDataForUserIds (array $a_user_ids, $a_recursive=true)
 
 gatherLPUsers ()
 
 updateParentCollections ()
 

Static Protected Member Functions

static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 
- Static Protected Member Functions inherited from ilObjectLP
static isLPMember (array &$a_res, $a_usr_id, $a_obj_ids)
 Find (lp-relevant) members for given object ids. More...
 
static findMembershipsByPath (array &$a_res, $a_usr_id, $a_parent_ref_id, array $a_obj_ids, $a_mapped_ref_ids=false)
 Find (lp-relevant) memberships by path. More...
 
static getTypeDefaultFromDB ($a_type)
 

Protected Attributes

 $testObj
 
- Protected Attributes inherited from ilObjectLP
 $tree
 
 $db
 
 $obj_id
 
 $collection_instance
 
 $mode
 

Additional Inherited Members

- Static Protected Attributes inherited from ilObjectLP
static $type_defaults
 

Detailed Description

Definition at line 13 of file class.ilTestLP.php.

Member Function Documentation

◆ getDefaultMode()

ilTestLP::getDefaultMode ( )

Definition at line 29 of file class.ilTestLP.php.

References ilLPObjSettings\LP_MODE_TEST_PASSED.

30  {
32  }

◆ getDefaultModes()

static ilTestLP::getDefaultModes (   $a_lp_active)
static

◆ getValidModes()

◆ isAnonymized()

ilTestLP::isAnonymized ( )

Definition at line 43 of file class.ilTestLP.php.

References ilObjTest\_lookupAnonymity().

44  {
45  include_once './Modules/Test/classes/class.ilObjTest.php';
46  return (bool) ilObjTest::_lookupAnonymity($this->obj_id);
47  }
static _lookupAnonymity($a_obj_id)
Returns the anonymity status of a test with a given object id.
+ Here is the call graph for this function:

◆ isLPMember()

static ilTestLP::isLPMember ( array &  $a_res,
  $a_usr_id,
  $a_obj_ids 
)
staticprotected

Definition at line 103 of file class.ilTestLP.php.

References $DIC, $ilDB, and $row.

104  {
105  global $DIC;
106  $ilDB = $DIC['ilDB'];
107 
108  // if active id
109  $set = $ilDB->query("SELECT tt.obj_fi" .
110  " FROM tst_active ta" .
111  " JOIN tst_tests tt ON (ta.test_fi = tt.test_id)" .
112  " WHERE " . $ilDB->in("tt.obj_fi", (array) $a_obj_ids, false, "integer") .
113  " AND ta.user_fi = " . $ilDB->quote($a_usr_id, "integer"));
114  while ($row = $ilDB->fetchAssoc($set)) {
115  $a_res[$row["obj_fi"]] = true;
116  }
117 
118  return true;
119  }
global $DIC
Definition: saml.php:7
$row
global $ilDB

◆ resetCustomLPDataForUserIds()

ilTestLP::resetCustomLPDataForUserIds ( array  $a_user_ids,
  $a_recursive = true 
)
protected

Definition at line 57 of file class.ilTestLP.php.

References $testObj, ilLPStatusFactory\_getInstance(), ilLOUserResults\deleteResultsFromLP(), ilObjectFactory\getInstanceByObjId(), ilLOSettings\getInstanceByObjId(), ilLOSettings\isObjectiveTest(), and ilLOTestAssignments\lookupObjectivesForTest().

58  {
59  /* @var ilObjTest $testOBJ */
60  if ($this->testObj) {
61  // #19247
62  $testOBJ = $this->testObj;
63  } else {
64  require_once 'Services/Object/classes/class.ilObjectFactory.php';
65  $testOBJ = ilObjectFactory::getInstanceByObjId($this->obj_id);
66  }
67  $testOBJ->removeTestResultsByUserIds($a_user_ids);
68 
69  // :TODO: there has to be a better way
70  $test_ref_id = (int) $_REQUEST["ref_id"];
71  if ($this->testObj && $this->testObj->getRefId()) {
72  $test_ref_id = $this->testObj->getRefId();
73  }
74  if ($test_ref_id) {
75  require_once "Modules/Course/classes/Objectives/class.ilLOSettings.php";
76  $course_obj_id = ilLOSettings::isObjectiveTest($test_ref_id);
77  if ($course_obj_id) {
78  // remove objective results data
79  $lo_settings = ilLOSettings::getInstanceByObjId($course_obj_id);
80 
81  require_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
82  include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
84  $course_obj_id,
85  $a_user_ids,
86  ($lo_settings->getInitialTest() == $test_ref_id),
87  ($lo_settings->getQualifiedTest() == $test_ref_id),
89  );
90 
91  // refresh LP - see ilLPStatusWrapper::_updateStatus()
92  require_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
93  $lp_status = ilLPStatusFactory::_getInstance($course_obj_id);
94  if (strtolower(get_class($lp_status)) != "illpstatus") {
95  foreach ($a_user_ids as $user_id) {
96  $lp_status->_updateStatus($course_obj_id, $user_id);
97  }
98  }
99  }
100  }
101  }
static getInstanceByObjId($a_obj_id)
get singleton instance
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
static _getInstance($a_obj_id, $a_mode=null)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static lookupObjectivesForTest($a_test_ref_id)
Get all objectives that are assigned to given test.
static deleteResultsFromLP($a_course_id, array $a_user_ids, $a_remove_initial, $a_remove_qualified, array $a_objective_ids)
Delete all (qualified) result entries for course members.
+ Here is the call graph for this function:

◆ setTestObject()

ilTestLP::setTestObject ( \ilObjTest  $test)
Parameters
ilObjTest$test

Definition at line 52 of file class.ilTestLP.php.

References $test.

53  {
54  $this->testObj = $test;
55  }
$test
Definition: Utf8Test.php:84

Field Documentation

◆ $testObj

ilTestLP::$testObj
protected

Definition at line 18 of file class.ilTestLP.php.

Referenced by resetCustomLPDataForUserIds().


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