ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 Get available type-specific default modes (no administration needed) More...
 
- 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)
 Find (lp-relevant) members for given object ids. More...
 
- 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
 $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 ( )

Reimplemented from ilObjectLP.

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

References ilLPObjSettings\LP_MODE_TEST_PASSED.

◆ getDefaultModes()

static ilTestLP::getDefaultModes (   $a_lp_active)
static

Get available type-specific default modes (no administration needed)

Parameters
bool$a_lp_active
Returns
array

Reimplemented from ilObjectLP.

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

References ilLPObjSettings\LP_MODE_DEACTIVATED, ilLPObjSettings\LP_MODE_TEST_FINISHED, and ilLPObjSettings\LP_MODE_TEST_PASSED.

◆ getValidModes()

◆ isAnonymized()

ilTestLP::isAnonymized ( )

Reimplemented from ilObjectLP.

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

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.

References ilObjTest\_lookupAnonymity().

+ Here is the call graph for this function:

◆ isLPMember()

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

Find (lp-relevant) members for given object ids.

Parameters
array$a_res
int$a_usr_id
array$a_obj_ids

Reimplemented from ilObjectLP.

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

112 {
113 global $ilDB;
114
115 // if active id
116 $set = $ilDB->query("SELECT tt.obj_fi".
117 " FROM tst_active ta".
118 " JOIN tst_tests tt ON (ta.test_fi = tt.test_id)".
119 " WHERE ".$ilDB->in("tt.obj_fi", (array)$a_obj_ids, "", "integer").
120 " AND ta.user_fi = ".$ilDB->quote($a_usr_id, "integer"));
121 while($row = $ilDB->fetchAssoc($set))
122 {
123 $a_res[$row["obj_fi"]] = true;
124 }
125
126 return true;
127 }
global $ilDB

References $ilDB, and $row.

◆ resetCustomLPDataForUserIds()

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

Reimplemented from ilObjectLP.

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

58 {
59 /* @var ilObjTest $testOBJ */
60 if($this->testObj)
61 {
62 // #19247
63 $testOBJ = $this->testObj;
64 }
65 else
66 {
67 require_once 'Services/Object/classes/class.ilObjectFactory.php';
68 $testOBJ = ilObjectFactory::getInstanceByObjId($this->obj_id);
69 }
70 $testOBJ->removeTestResultsByUserIds($a_user_ids);
71
72 // :TODO: there has to be a better way
73 $test_ref_id = (int)$_REQUEST["ref_id"];
74 if($this->testObj && $this->testObj->getRefId())
75 {
76 $test_ref_id = $this->testObj->getRefId();
77 }
78 if($test_ref_id)
79 {
80 require_once "Modules/Course/classes/Objectives/class.ilLOSettings.php";
81 $course_obj_id = ilLOSettings::isObjectiveTest($test_ref_id);
82 if($course_obj_id)
83 {
84 // remove objective results data
85 $lo_settings = ilLOSettings::getInstanceByObjId($course_obj_id);
86
87 require_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
88 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
90 $course_obj_id,
91 $a_user_ids,
92 ($lo_settings->getInitialTest() == $test_ref_id),
93 ($lo_settings->getQualifiedTest() == $test_ref_id),
95 );
96
97 // refresh LP - see ilLPStatusWrapper::_updateStatus()
98 require_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
99 $lp_status = ilLPStatusFactory::_getInstance($course_obj_id);
100 if (strtolower(get_class($lp_status)) != "illpstatus")
101 {
102 foreach($a_user_ids as $user_id)
103 {
104 $lp_status->_updateStatus($course_obj_id, $user_id);
105 }
106 }
107 }
108 }
109 }
static isObjectiveTest($a_trst_ref_id)
Check if test ref_id is used in an objective course.
static getInstanceByObjId($a_obj_id)
get singleton instance
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.
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

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

+ 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.

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

References $test.

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: