ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilLPStatusExerciseReturned Class Reference
+ Inheritance diagram for ilLPStatusExerciseReturned:
+ Collaboration diagram for ilLPStatusExerciseReturned:

Public Member Functions

 determineStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 Determine status. More...
 
 init (Container $DIC)
 
 getLPStatusId ()
 
 getLabel ()
 
 getInfo ()
 
- Public Member Functions inherited from ilLPStatus
 __construct (int $a_obj_id)
 
 _updateStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) Learning progress: More...
 
 determinePercentage (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
 determineStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 
 init (\ILIAS\DI\Container $DIC)
 
 getCustomLPSettingsExportXML (int $object_id)
 
 importCustomLPSettingsExportXML (int $new_object_id, ilImportMapping $a_mapping, SimpleXMLElement $additional_xml_root)
 
 getLPStatusId ()
 
 getLabel ()
 
 getInfo ()
 
 init (Container $DIC)
 
 getCustomLPSettingsExportXML (int $object_id)
 
 importCustomLPSettingsExportXML (int $new_object_id, ilImportMapping $a_mapping, SimpleXMLElement $additional_xml_root)
 
 getLPStatusId ()
 
 getLabel ()
 
 getInfo ()
 

Static Public Member Functions

static _getNotAttempted (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getCountFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _getTypicalLearningTime (string $type, int $obj_id, int $sub_id=0)
 
static checkStatusForObject (int $a_obj_id, ?array $a_users=null)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus (int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted (int $a_obj_id, int $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty (int $a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus (int $a_obj_id, int $a_user_id, bool $a_create=true)
 Lookup status. More...
 
static _lookupPercentage (int $a_obj_id, int $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted (int $a_obj_id, int $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged (int $a_obj_id, int $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData (array $a_obj_ids)
 
static getListGUIStatus (int $a_obj_id, bool $a_image_only=true)
 
static hasListGUIStatus (int $a_obj_id)
 

Static Protected Member Functions

static getMembers (int $a_obj_id)
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent (int $a_obj_id, int $a_usr_id, int $a_status, int $a_old_status, int $a_percentage)
 
static _lookupStatusForObject (int $a_obj_id, int $a_status, ?array $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects (int $a_user_id, array $a_obj_ids, int $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects (array $a_obj_ids, array &$a_coll_obj_ids)
 implements Process lp modes for given objects More...
 
static getLPStatusForObjects (int $a_user_id, array $a_obj_ids)
 Get LP status for given objects (and user) More...
 

Protected Attributes

const string LNG_TEXT = 'trac_mode_exercise_returned'
 
const string LNG_TEXT_INFO = 'trac_mode_exercise_returned_info'
 
ilLanguage $lng
 
- Protected Attributes inherited from ilLPStatus
int $obj_id
 
ilDBInterface $db
 
ilObjectDataCache $ilObjDataCache
 

Additional Inherited Members

- Data Fields inherited from ilLPStatus
const string LP_STATUS_NOT_ATTEMPTED = 'trac_no_attempted'
 
const string LP_STATUS_IN_PROGRESS = 'trac_in_progress'
 
const string LP_STATUS_COMPLETED = 'trac_completed'
 
const string LP_STATUS_FAILED = 'trac_failed'
 
const int LP_STATUS_NOT_ATTEMPTED_NUM = 0
 
const int LP_STATUS_IN_PROGRESS_NUM = 1
 
const int LP_STATUS_COMPLETED_NUM = 2
 
const int LP_STATUS_FAILED_NUM = 3
 
const string LP_STATUS_REGISTERED = 'trac_registered'
 
const string LP_STATUS_NOT_REGISTERED = 'trac_not_registered'
 
const string LP_ut_lp_markSTATUS_PARTICIPATED = 'trac_participated'
 
const string LP_STATUS_NOT_PARTICIPATED = 'trac_not_participated'
 
- Static Public Attributes inherited from ilLPStatus
static array $list_gui_cache
 

Detailed Description

Definition at line 23 of file class.ilLPStatusExerciseReturned.php.

Member Function Documentation

◆ _getCompleted()

static ilLPStatusExerciseReturned::_getCompleted ( int  $a_obj_id)
static
Returns
int[]

Reimplemented from ilLPStatus.

Definition at line 67 of file class.ilLPStatusExerciseReturned.php.

67 : array
68 {
69 return ilExerciseMembers::_getPassedUsers($a_obj_id);
70 }
static _getPassedUsers(int $a_obj_id)
Get all users that passed the exercise.

References ilExerciseMembers\_getPassedUsers().

+ Here is the call graph for this function:

◆ _getFailed()

static ilLPStatusExerciseReturned::_getFailed ( int  $a_obj_id)
static
Returns
int[]

Reimplemented from ilLPStatus.

Definition at line 72 of file class.ilLPStatusExerciseReturned.php.

72 : array
73 {
74 return ilExerciseMembers::_getFailedUsers($a_obj_id);
75 }
static _getFailedUsers(int $a_obj_id)
Get all users that failed the exercise.

References ilExerciseMembers\_getFailedUsers().

+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusExerciseReturned::_getInProgress ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 50 of file class.ilLPStatusExerciseReturned.php.

50 : array
51 {
52 $users = ilExerciseMembers::_getReturned($a_obj_id);
54 $users = $users + $all;
55 $users = array_diff(
56 $users,
58 );
59 $users = array_diff($users, ilLPStatusWrapper::_getFailed($a_obj_id));
60 if ($users) {
61 // Exclude all non members
62 $users = array_intersect(self::getMembers($a_obj_id), $users);
63 }
64 return $users;
65 }
static lookupUsersInProgress(int $a_obj_id)
static _getReturned(int $a_obj_id)
Get returned status for all members (if they have anything returned for any assignment)
static _getFailed(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilExerciseMembers\_getReturned(), and ilChangeEvent\lookupUsersInProgress().

+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusExerciseReturned::_getNotAttempted ( int  $a_obj_id)
static
Returns
int[]

Reimplemented from ilLPStatus.

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

29 : array
30 {
31 $users = [];
32 $members = self::getMembers($a_obj_id);
33 if ($members) {
34 $users = array_diff(
35 $members,
37 );
38 $users = array_diff(
39 $users,
41 );
42 $users = array_diff(
43 $users,
45 );
46 }
47 return $users;
48 }
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), and getMembers().

+ Here is the call graph for this function:

◆ _lookupCompletedForObject()

static ilLPStatusExerciseReturned::_lookupCompletedForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get completed users for object.

Reimplemented from ilLPStatus.

Definition at line 113 of file class.ilLPStatusExerciseReturned.php.

116 : array {
117 if (!$a_user_ids) {
118 $a_user_ids = self::getMembers($a_obj_id);
119 if (!$a_user_ids) {
120 return [];
121 }
122 }
124 $a_obj_id,
125 self::LP_STATUS_COMPLETED_NUM,
126 $a_user_ids
127 );
128 }
static _lookupStatusForObject(int $a_obj_id, int $a_status, ?array $a_user_ids=null)
Get users with given status for object.

◆ _lookupFailedForObject()

static ilLPStatusExerciseReturned::_lookupFailedForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get failed users for object.

Reimplemented from ilLPStatus.

Definition at line 133 of file class.ilLPStatusExerciseReturned.php.

136 : array {
137 if (!$a_user_ids) {
138 $a_user_ids = self::getMembers($a_obj_id);
139 if (!$a_user_ids) {
140 return [];
141 }
142 }
144 $a_obj_id,
145 self::LP_STATUS_FAILED_NUM,
146 $a_user_ids
147 );
148 }

◆ _lookupInProgressForObject()

static ilLPStatusExerciseReturned::_lookupInProgressForObject ( int  $a_obj_id,
?array  $a_user_ids = null 
)
static

Get in progress users for object.

Reimplemented from ilLPStatus.

Definition at line 153 of file class.ilLPStatusExerciseReturned.php.

156 : array {
157 if (!$a_user_ids) {
158 $a_user_ids = self::getMembers($a_obj_id);
159 if (!$a_user_ids) {
160 return [];
161 }
162 }
164 $a_obj_id,
165 self::LP_STATUS_IN_PROGRESS_NUM,
166 $a_user_ids
167 );
168 }

◆ determineStatus()

ilLPStatusExerciseReturned::determineStatus ( int  $a_obj_id,
int  $a_usr_id,
?object  $a_obj = null 
)

Determine status.

Reimplemented from ilLPStatus.

Definition at line 80 of file class.ilLPStatusExerciseReturned.php.

84 : int {
86 if (strcmp($this->ilObjDataCache->lookupType($a_obj_id), 'exc') === 0) {
87 if (ilChangeEvent::hasAccessed($a_obj_id, $a_usr_id) ||
88 ilExerciseMembers::_hasReturned($a_obj_id, $a_usr_id)) {
90 }
92 $a_obj_id,
93 $a_usr_id
94 );
95 if ($ex_stat == "passed") {
97 }
98 if ($ex_stat == "failed") {
100 }
101 }
102 return $status;
103 }
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
static _hasReturned(int $a_obj_id, int $a_user_id)
Has user returned anything in any assignment?
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current status (notgraded|passed|failed)
const int LP_STATUS_FAILED_NUM
const int LP_STATUS_COMPLETED_NUM
const int LP_STATUS_IN_PROGRESS_NUM
const int LP_STATUS_NOT_ATTEMPTED_NUM

References ilExerciseMembers\_hasReturned(), ilExerciseMembers\_lookupStatus(), ilChangeEvent\hasAccessed(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, and ilLPStatus\LP_STATUS_IN_PROGRESS_NUM.

+ Here is the call graph for this function:

◆ getInfo()

ilLPStatusExerciseReturned::getInfo ( )

Reimplemented from ilLPStatus.

Definition at line 187 of file class.ilLPStatusExerciseReturned.php.

187 : string
188 {
189 return $this->lng->txt(self::LNG_TEXT_INFO);
190 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLabel()

ilLPStatusExerciseReturned::getLabel ( )

Reimplemented from ilLPStatus.

Definition at line 182 of file class.ilLPStatusExerciseReturned.php.

182 : string
183 {
184 return $this->lng->txt(self::LNG_TEXT);
185 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLPStatusId()

ilLPStatusExerciseReturned::getLPStatusId ( )

Reimplemented from ilLPStatus.

Definition at line 177 of file class.ilLPStatusExerciseReturned.php.

177 : string
178 {
180 }
const int LP_MODE_EXERCISE_RETURNED

References ilLPObjSettings\LP_MODE_EXERCISE_RETURNED.

◆ getMembers()

static ilLPStatusExerciseReturned::getMembers ( int  $a_obj_id)
staticprotected

Definition at line 105 of file class.ilLPStatusExerciseReturned.php.

106 {
107 return ilExerciseMembers::_getMembers($a_obj_id);
108 }
static _getMembers(int $a_obj_id)

References ilExerciseMembers\_getMembers().

Referenced by _getNotAttempted().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilLPStatusExerciseReturned::init ( Container  $DIC)

Implements ILIAS\Tracking\Status\LPStatusInterface.

Definition at line 170 of file class.ilLPStatusExerciseReturned.php.

172 : void {
173 $this->lng = $DIC->language();
174 }
language()
Get interface to the i18n service.
Definition: Container.php:95

Field Documentation

◆ $lng

ilLanguage ilLPStatusExerciseReturned::$lng
protected

Definition at line 27 of file class.ilLPStatusExerciseReturned.php.

◆ LNG_TEXT

const string ilLPStatusExerciseReturned::LNG_TEXT = 'trac_mode_exercise_returned'
protected

Definition at line 25 of file class.ilLPStatusExerciseReturned.php.

◆ LNG_TEXT_INFO

const string ilLPStatusExerciseReturned::LNG_TEXT_INFO = 'trac_mode_exercise_returned_info'
protected

Definition at line 26 of file class.ilLPStatusExerciseReturned.php.


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