ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 

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, array $a_obj_ids)
 
- Static Protected Member Functions inherited from ilObjectLP
static getTypeClass ($a_type)
 
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...
 

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectLP
static getInstance ($a_obj_id)
 
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)
 

Detailed Description

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

Member Function Documentation

◆ getDefaultMode()

ilTestLP::getDefaultMode ( )

Reimplemented from ilObjectLP.

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

References ilLPObjSettings\LP_MODE_TEST_PASSED.

◆ getValidModes()

◆ isAnonymized()

ilTestLP::isAnonymized ( )

Reimplemented from ilObjectLP.

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

35 {
36 include_once './Modules/Test/classes/class.ilObjTest.php';
37 return (bool)ilObjTest::_lookupAnonymity($this->obj_id);
38 }
_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,
array  $a_obj_ids 
)
staticprotected

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

99 {
100 global $ilDB;
101
102 // if active id
103 $set = $ilDB->query("SELECT tt.obj_fi".
104 " FROM tst_active ta".
105 " JOIN tst_tests tt ON (ta.test_fi = tt.test_id)".
106 " WHERE ".$ilDB->in("tt.obj_fi", $a_obj_ids, "", "integer").
107 " AND ta.user_fi = ".$ilDB->quote($a_usr_id, "integer"));
108 while($row = $ilDB->fetchAssoc($set))
109 {
110 $a_res[$row["obj_fi"]] = true;
111 }
112
113 return true;
114 }
global $ilDB

References $ilDB, and $row.

◆ resetCustomLPDataForUserIds()

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

Reimplemented from ilObjectLP.

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

49 {
50 /* @var ilObjTest $testOBJ */
51 if($this->testObj)
52 {
53 // #19247
54 $testOBJ = $this->testObj;
55 }
56 else
57 {
58 require_once 'Services/Object/classes/class.ilObjectFactory.php';
59 $testOBJ = ilObjectFactory::getInstanceByObjId($this->obj_id);
60 }
61 $testOBJ->removeTestResultsByUserIds($a_user_ids);
62
63 // :TODO: there has to be a better way
64 $test_ref_id = (int)$_REQUEST["ref_id"];
65 if($this->testObj && $this->testObj->getRefId())
66 {
67 $test_ref_id = $this->testObj->getRefId();
68 }
69 if($test_ref_id)
70 {
71 require_once "Modules/Course/classes/Objectives/class.ilLOSettings.php";
72 $course_obj_id = ilLOSettings::isObjectiveTest($test_ref_id);
73 if($course_obj_id)
74 {
75 // is test initial and/or qualified?
76 $lo_settings = ilLOSettings::getInstanceByObjId($course_obj_id);
77 $is_i = ($lo_settings->getInitialTest() == $test_ref_id);
78 $is_q = ($lo_settings->getQualifiedTest() == $test_ref_id);
79
80 // remove objective results data
81 require_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
82 ilLOUserResults::deleteResultsFromLP($course_obj_id, $a_user_ids, $is_i, $is_q);
83
84 // refresh LP - see ilLPStatusWrapper::_updateStatus()
85 require_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
86 $lp_status = ilLPStatusFactory::_getInstance($course_obj_id);
87 if (strtolower(get_class($lp_status)) != "illpstatus")
88 {
89 foreach($a_user_ids as $user_id)
90 {
91 $lp_status->_updateStatus($course_obj_id, $user_id);
92 }
93 }
94 }
95 }
96 }
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 deleteResultsFromLP($a_course_id, array $a_user_ids, $a_remove_initial, $a_remove_qualified)
Delete all (qualified) result entries for course members.
_getInstance($a_obj_id, $a_mode=NULL)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

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

+ Here is the call graph for this function:

◆ setTestObject()

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

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

44 {
45 $this->testObj = $test;
46 }
$test
Definition: Utf8Test.php:85

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: