ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilObjExerciseAccess Class Reference

Class ilObjExerciseAccess. More...

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

Public Member Functions

 _getCommands ()
 get commands More...
 
 _lookupRemainingWorkingTimeString ($a_obj_id)
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Static Public Member Functions

static getConditionOperators ()
 Get possible conditions operators. More...
 
static checkCondition ($a_exc_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Class ilObjExerciseAccess.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ _checkGoto()

ilObjExerciseAccess::_checkGoto (   $a_target)

check whether goto script will succeed

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

138  {
139  global $ilAccess;
140 
141  $t_arr = explode("_", $a_target);
142 
143  if ($t_arr[0] != "exc" || ((int) $t_arr[1]) <= 0)
144  {
145  return false;
146  }
147 
148  if ($ilAccess->checkAccess("read", "", $t_arr[1]))
149  {
150  return true;
151  }
152  return false;
153  }

◆ _getCommands()

ilObjExerciseAccess::_getCommands ( )

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"), );

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

Referenced by ilObjExerciseListGUI\init().

81  {
82  $commands = array
83  (
84  array("permission" => "read", "cmd" => "showOverview", "lang_var" => "show",
85  "default" => true),
86  array("permission" => "write", "cmd" => "listAssignments", "lang_var" => "edit_assignments"),
87  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
88  );
89 
90  return $commands;
91  }
+ Here is the caller graph for this function:

◆ _lookupRemainingWorkingTimeString()

ilObjExerciseAccess::_lookupRemainingWorkingTimeString (   $a_obj_id)

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

References $ilDB, $row, IL_CAL_UNIX, and ilUtil\period2String().

Referenced by ilObjExerciseListGUI\getProperties().

94  {
95  global $ilDB;
96 
97  // #14077 - mind peer deadline, too
98 
99  $dl = null;
100  $cnt = array();
101 
102  $q = "SELECT id, time_stamp, peer_dl".
103  " FROM exc_assignment WHERE exc_id = ".$ilDB->quote($a_obj_id, "integer").
104  " AND (time_stamp > ".$ilDB->quote(time(), "integer").
105  " OR (peer_dl > ".$ilDB->quote(time(), "integer").
106  " AND peer > ".$ilDB->quote(0, "integer")."))";
107  $set = $ilDB->query($q);
108  while($row = $ilDB->fetchAssoc($set))
109  {
110  if($row["time_stamp"] > time() &&
111  ($row["time_stamp"] < $dl || !$dl))
112  {
113  $dl = $row["time_stamp"];
114  }
115  if($row["peer_dl"] > time() &&
116  ($row["peer_dl"] < $dl || !$dl))
117  {
118  $dl = $row["peer_dl"];
119  }
120  $cnt[$row["id"]] = true;
121  }
122 
123  if($dl)
124  {
126  }
127 
128  return array(
129  "mtime" => $dl,
130  "cnt" => sizeof($cnt)
131  );
132  }
const IL_CAL_UNIX
static period2String(ilDateTime $a_from, $a_to=null)
Return a string of time period.
Date and time handling
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCondition()

static ilObjExerciseAccess::checkCondition (   $a_exc_id,
  $a_operator,
  $a_value,
  $a_usr_id 
)
static

check condition

Parameters
type$a_exc_id
type$a_operator
type$a_value
type$a_usr_id
Returns
boolean

Implements ilConditionHandling.

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

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

41  {
42  include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
43  include_once './Modules/Exercise/classes/class.ilExerciseMembers.php';
44 
45  switch($a_operator)
46  {
48  if (ilExerciseMembers::_lookupStatus($a_exc_id, $a_usr_id) == "passed")
49  {
50  return true;
51  }
52  else
53  {
54  return false;
55  }
56  break;
57 
59  return ilExerciseMembers::_lookupStatus($a_exc_id,$a_usr_id) == 'failed';
60 
61  default:
62  return true;
63  }
64  return true;
65  }
_lookupStatus($a_obj_id, $a_user_id)
Lookup current status (notgraded|passed|failed)
+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjExerciseAccess::getConditionOperators ( )
static

Get possible conditions operators.

Implements ilConditionHandling.

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

References ilConditionHandler\OPERATOR_FAILED, and ilConditionHandler\OPERATOR_PASSED.

23  {
24  include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
25  return array(
28  );
29  }

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