ILIAS  release_8 Revision v8.24
ilObjExerciseAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjExerciseAccess:
+ Collaboration diagram for ilObjExerciseAccess:

Public Member Functions

 canBeDelivered (ilWACPath $ilWACPath)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static getConditionOperators ()
 Get possible conditions operators. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 check condition More...
 
static _getCommands ()
 get commands More...
 
static _lookupRemainingWorkingTimeString (int $a_obj_id)
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 
static getConditionOperators ()
 Returns an array with valid operators for the specific object type. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 check condition for a specific user and object More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 22 of file class.ilObjExerciseAccess.php.

Member Function Documentation

◆ _checkGoto()

static ilObjExerciseAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Definition at line 132 of file class.ilObjExerciseAccess.php.

132 : bool
133 {
134 global $DIC;
135
136 $ilAccess = $DIC->access();
137
138 $t_arr = explode("_", $a_target);
139
140 if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0) {
141 return false;
142 }
143 return $ilAccess->checkAccess("read", "", $t_arr[1]) ||
144 $ilAccess->checkAccess("visible", "", $t_arr[1]);
145 }
global $DIC
Definition: feed.php:28

References $DIC.

◆ _getCommands()

static ilObjExerciseAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Reimplemented from ilObjectAccess.

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

67 : array
68 {
69 return array(
70 array("permission" => "read", "cmd" => "showOverview", "lang_var" => "show",
71 "default" => true),
72 array("permission" => "write", "cmd" => "listAssignments", "lang_var" => "edit_assignments"),
73 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
74 );
75 }

Referenced by ilObjExerciseListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupRemainingWorkingTimeString()

static ilObjExerciseAccess::_lookupRemainingWorkingTimeString ( int  $a_obj_id)
static
Exceptions
ilDateTimeException

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

82 : array {
83 global $DIC;
84
85 $ilDB = $DIC->database();
86
87 // #14077 - mind peer deadline, too
88
89 $dl = null;
90 $cnt = array();
91
92 $q = "SELECT id, time_stamp, deadline2, peer_dl" .
93 " FROM exc_assignment WHERE exc_id = " . $ilDB->quote($a_obj_id, "integer") .
94 " AND (time_stamp > " . $ilDB->quote(time(), "integer") .
95 " OR (peer_dl > " . $ilDB->quote(time(), "integer") .
96 " AND peer > " . $ilDB->quote(0, "integer") . "))";
97 $set = $ilDB->query($q);
98 while ($row = $ilDB->fetchAssoc($set)) {
99 if ($row["time_stamp"] > time() &&
100 ($row["time_stamp"] < $dl || !$dl)) {
101 $dl = $row["time_stamp"];
102 }
103 /* extended deadline should not be presented anywhere
104 if($row["deadline2"] > time() &&
105 ($row["deadline2"] < $dl || !$dl))
106 {
107 $dl = $row["deadline2"];
108 }
109 */
110 if ($row["peer_dl"] > time() &&
111 ($row["peer_dl"] < $dl || !$dl)) {
112 $dl = $row["peer_dl"];
113 }
114 $cnt[$row["id"]] = true;
115 }
116
117 // :TODO: mind personal deadline?
118
119 if ($dl) {
121 }
122
123 return array(
124 "mtime" => $dl,
125 "cnt" => count($cnt)
126 );
127 }
const IL_CAL_UNIX
@classDescription Date and time handling
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.

Referenced by ilObjExerciseListGUI\getProperties().

+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjExerciseAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Reimplemented from ilObjectAccess.

Definition at line 147 of file class.ilObjExerciseAccess.php.

147 : bool
148 {
149 return true;
150 }

◆ checkCondition()

static ilObjExerciseAccess::checkCondition ( int  $a_trigger_obj_id,
string  $a_operator,
string  $a_value,
int  $a_usr_id 
)
static

check condition

Implements ilConditionHandling.

Definition at line 40 of file class.ilObjExerciseAccess.php.

40 : bool
41 {
42 switch ($a_operator) {
44 return ilExerciseMembers::_lookupStatus($a_trigger_obj_id, $a_usr_id) == "passed";
45
47 return ilExerciseMembers::_lookupStatus($a_trigger_obj_id, $a_usr_id) == 'failed';
48
49 default:
50 return true;
51 }
52 }
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current status (notgraded|passed|failed)

References ilExerciseMembers\_lookupStatus(), ilConditionHandler\OPERATOR_FAILED, and ilConditionHandler\OPERATOR_PASSED.

+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjExerciseAccess::getConditionOperators ( )
static

Get possible conditions operators.

Returns
string[]

Implements ilConditionHandling.

Definition at line 28 of file class.ilObjExerciseAccess.php.

28 : array
29 {
30 return array(
33 );
34 }

References ilConditionHandler\OPERATOR_FAILED, and ilConditionHandler\OPERATOR_PASSED.


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