ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjTestAccess.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 
42 {
43  private ilDBInterface $db;
44  private ilObjUser $user;
45  private ilLanguage $lng;
48 
49  public function __construct()
50  {
52  global $DIC;
53  $this->db = $DIC['ilDB'];
54  $this->user = $DIC['ilUser'];
55  $this->lng = $DIC['lng'];
56  $this->rbac_system = $DIC['rbacsystem'];
57  $this->access = $DIC['ilAccess'];
58  }
59 
60  public function canBeDelivered(ilWACPath $ilWACPath): bool
61  {
62  $readable = new Readable($this->access);
63 
64  $can_it = $this->findMatch($ilWACPath->getPath(), [
65  new AccessFileUploadAnswer($this->user, $this->db, $readable),
66  new AccessQuestionImage($readable),
67  new AccessFileUploadPreview($this->db, $this->access),
68  ]);
69 
70 
71  return !$can_it->isOk() || $can_it->value();
72  }
73 
74  private function findMatch(string $path, array $array): Result
75  {
76  return array_reduce($array, fn(Result $result, SimpleAccess $access) => $result->except(
77  fn() => $access->isPermitted($path)
78  ), new Error('Not a known path.'));
79  }
80 
88  public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, int $user_id = null): bool
89  {
90  if (is_null($user_id)) {
91  $user_id = $this->user->getId();
92  }
93 
94  $is_admin = $this->rbac_system->checkAccessOfUser($user_id, 'write', $ref_id);
95 
96 
97  switch ($permission) {
98  case "visible":
99  case "read":
101  !$is_admin) {
102  $this->access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $this->lng->txt("tst_warning_test_not_complete"));
103  return false;
104  }
105  break;
106  }
107 
108  switch ($cmd) {
109  case "eval_a":
110  case "eval_stat":
112  $this->access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $this->lng->txt("tst_warning_test_not_complete"));
113  return false;
114  }
115  break;
116  }
117 
118  return true;
119  }
120 
128  public static function _isPassed($user_id, $a_obj_id): bool
129  {
130  global $DIC;
131  $ilDB = $DIC['ilDB'];
132 
133  $test = new ilObjTest($a_obj_id, false);
134 
135  $result = $ilDB->queryF(
136  "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
137  ['integer','integer'],
138  [$user_id, $a_obj_id]
139  );
140  if (!$result->numRows()) {
141  $result = $ilDB->queryF(
142  "SELECT tst_active.active_id FROM tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s",
143  ['integer','integer'],
144  [$user_id, $a_obj_id]
145  );
146  $row = $ilDB->fetchAssoc($result);
147  if ($row !== null && $row['active_id'] > 0) {
148  $test->updateTestResultCache($row['active_id']);
149  } else {
150  return false;
151  }
152  }
153  $result = $ilDB->queryF(
154  "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
155  ['integer','integer'],
156  [$user_id, $a_obj_id]
157  );
158  if (!$result->numRows()) {
159  $result = $ilDB->queryF(
160  "SELECT tst_pass_result.*, tst_tests.pass_scoring, tst_tests.test_id FROM tst_pass_result, tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s AND tst_pass_result.active_fi = tst_active.active_id ORDER BY tst_pass_result.pass",
161  ['integer','integer'],
162  [$user_id, $a_obj_id]
163  );
164 
165  if (!$result->numRows()) {
166  return false;
167  }
168 
169  $points = [];
170  while ($row = $ilDB->fetchAssoc($result)) {
171  array_push($points, $row);
172  }
173  $reached = 0;
174  $max = 0;
175  if ($points[0]["pass_scoring"] == 0) {
176  $reached = $points[count($points) - 1]["points"];
177  $max = $points[count($points) - 1]["maxpoints"];
178  if (!$max) {
179  $active_id = $points[count($points) - 1]["active_fi"];
180  $pass = $points[count($points) - 1]["pass"];
181  if (strlen($active_id) && strlen($pass)) {
182  $res = $test->updateTestPassResults($active_id, $pass, false, null, $a_obj_id);
183  $max = $res['maxpoints'];
184  $reached = $res['points'];
185  }
186  }
187  } else {
188  foreach ($points as $row) {
189  if ($row["points"] > $reached) {
190  $reached = $row["points"];
191  $max = $row["maxpoints"];
192  if (!$max) {
193  $active_id = $row["active_fi"];
194  $pass = $row["pass"];
195  if (strlen($active_id) && strlen($pass)) {
196  $res = $test->updateTestPassResults($active_id, $pass, false, null, $a_obj_id);
197  $max = $res['maxpoints'];
198  $reached = $res['points'];
199  }
200  }
201  }
202  }
203  }
204  $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
205  return $test->getMarkSchema()->getMatchingMark($percentage)->getPassed() === 1;
206  } else {
207  $row = $ilDB->fetchAssoc($result);
208  return ($row['passed']) ? true : false;
209  }
210  }
211 
219  public static function isFailed($user_id, $a_obj_id): bool
220  {
221  global $DIC;
222  $ilDB = $DIC['ilDB'];
223 
224  $ret = self::updateTestResultCache($user_id, $a_obj_id);
225 
226  if (!$ret) {
227  return false;
228  }
229 
230  $test = new ilObjTest($a_obj_id, false);
231 
232  $result = $ilDB->queryF(
233  "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
234  ['integer','integer'],
235  [$user_id, $a_obj_id]
236  );
237 
238  if (!$result->numRows()) {
239  $result = $ilDB->queryF(
240  "SELECT tst_pass_result.*, tst_tests.pass_scoring FROM tst_pass_result, tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s AND tst_pass_result.active_fi = tst_active.active_id ORDER BY tst_pass_result.pass",
241  ['integer','integer'],
242  [$user_id, $a_obj_id]
243  );
244 
245  while ($row = $ilDB->fetchAssoc($result)) {
246  array_push($points, $row);
247  }
248  $reached = 0;
249  $max = 0;
250  if ($points[0]["pass_scoring"] == 0) {
251  $reached = $points[count($points) - 1]["points"];
252  $max = $points[count($points) - 1]["maxpoints"];
253  if (!$max) {
254  $active_id = $points[count($points) - 1]["active_fi"];
255  $pass = $points[count($points) - 1]["pass"];
256  if (strlen($active_id) && strlen($pass)) {
257  $res = $test->updateTestPassResults($active_id, $pass, false, null, $a_obj_id);
258  $max = $res['maxpoints'];
259  $reached = $res['points'];
260  }
261  }
262  } else {
263  foreach ($points as $row) {
264  if ($row["points"] > $reached) {
265  $reached = $row["points"];
266  $max = $row["maxpoints"];
267  if (!$max) {
268  $active_id = $row["active_fi"];
269  $pass = $row["pass"];
270  if (strlen($active_id) && strlen($pass)) {
271  $res = $test->updateTestPassResults($active_id, $pass, false, null, $a_obj_id);
272  $max = $res['maxpoints'];
273  $reached = $res['points'];
274  }
275  }
276  }
277  }
278  }
279  $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
280  return $test->getMarkSchema()->getMatchingMark($percentage)->getPassed() === 0;
281  } else {
282  $row = $ilDB->fetchAssoc($result);
283  return ($row['failed']) ? true : false;
284  }
285  }
286 
287  protected static function updateTestResultCache($a_user_id, $a_obj_id): bool
288  {
289  global $DIC;
290  $ilDB = $DIC['ilDB'];
291 
292  $result = $ilDB->queryF(
293  "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests " .
294  "WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s " .
295  "AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
296  ['integer','integer'],
297  [$a_user_id, $a_obj_id]
298  );
299  if (!$result->numRows()) {
300  $result = $ilDB->queryF(
301  "SELECT tst_active.active_id FROM tst_active, tst_tests WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s AND tst_tests.obj_fi = %s",
302  ['integer','integer'],
303  [$a_user_id, $a_obj_id]
304  );
305  $row = $ilDB->fetchAssoc($result);
306  if ($row !== null && $row['active_id'] > 0) {
307  $test = new ilObjTest($a_obj_id, false);
308  $test->updateTestResultCache($row['active_id']);
309  return true;
310  } else {
311  return false;
312  }
313  } else {
314  return true;
315  }
316  }
317 
318 
322  public static function getConditionOperators(): array
323  {
324  return [
329  ];
330  }
331 
332 
338  public static function checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id): bool
339  {
340  switch ($a_operator) {
342  return ilObjTestAccess::_isPassed($a_usr_id, $a_trigger_obj_id);
343  break;
344 
346  return ilObjTestAccess::isFailed($a_usr_id, $a_trigger_obj_id);
347 
349  return ilObjTestAccess::hasFinished($a_usr_id, $a_trigger_obj_id);
350 
352  return !ilObjTestAccess::hasFinished($a_usr_id, $a_trigger_obj_id);
353 
354  default:
355  return true;
356  }
357  return true;
358  }
359 
360  public static function _getCommands(): array
361  {
362  global $DIC;
363  $DIC->language()->loadLanguageModule('assessment');
364 
365  $commands = [
366  ["permission" => "write", "cmd" => "questionsTabGateway", "lang_var" => "tst_edit_questions"],
367  ["permission" => "write", "cmd" => "ilObjTestSettingsMainGUI::showForm", "lang_var" => "settings"],
368  ["permission" => "read", "cmd" => "ilTestScreenGUI::testScreen", "lang_var" => "tst_run", "default" => true],
369  ["permission" => "tst_statistics", "cmd" => "outEvaluation", "lang_var" => "tst_statistical_evaluation"],
370  ["permission" => "read", "cmd" => "userResultsGateway", "lang_var" => "tst_user_results"],
371  ["permission" => "write", "cmd" => "testResultsGateway", "lang_var" => "results"],
372  ["permission" => "eval_a", "cmd" => "testResultsGateway", "lang_var" => "results"]
373  ];
374 
375  return $commands;
376  }
377 
378  //
379  // object specific access related methods
380  //
381 
385  public static function _lookupCreationComplete($a_obj_id): bool
386  {
387  global $DIC;
388  $ilDB = $DIC['ilDB'];
389 
390  $result = $ilDB->queryF(
391  "SELECT complete FROM tst_tests WHERE obj_fi=%s",
392  ['integer'],
393  [$a_obj_id]
394  );
395  if ($result->numRows() == 1) {
396  $row = $ilDB->fetchAssoc($result);
397  }
398 
399  return isset($row['complete']) && $row['complete'];
400  }
401 
407  private static $hasFinishedCache = [];
408 
416  public static function hasFinished($a_user_id, $a_obj_id): bool
417  {
419  global $DIC;
420 
421  $ilDB = $DIC['ilDB'];
422  $lng = $DIC['lng'];
423  $ilUser = $DIC['ilUser'];
424 
425  if (!isset(self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"])) {
426  $testOBJ = ilObjectFactory::getInstanceByObjId($a_obj_id);
427 
428  $partData = new ilTestParticipantData($ilDB, $lng);
429  $partData->setUserIdsFilter([$a_user_id]);
430  $partData->load($testOBJ->getTestId());
431 
432  $activeId = $partData->getActiveIdByUserId($a_user_id);
433 
435  $testSessionFactory = new ilTestSessionFactory($testOBJ, $ilDB, $ilUser);
436  $testSession = $testSessionFactory->getSession($activeId);
438  $testPassesSelector = new ilTestPassesSelector($ilDB, $testOBJ);
439  $testPassesSelector->setActiveId($activeId);
440  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
441 
442  self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"] = count($testPassesSelector->getClosedPasses());
443  }
444 
445  return (bool) self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"];
446  }
447 
455  public static function _getTestIDFromObjectID($object_id)
456  {
457  global $DIC;
458  $ilDB = $DIC['ilDB'];
459  $test_id = false;
460  $result = $ilDB->queryF(
461  "SELECT test_id FROM tst_tests WHERE obj_fi = %s",
462  ['integer'],
463  [$object_id]
464  );
465  if ($result->numRows()) {
466  $row = $ilDB->fetchAssoc($result);
467  $test_id = $row["test_id"];
468  }
469  return $test_id;
470  }
471 
478  public static function _lookupObjIdForTestId($a_test_id): int
479  {
480  global $DIC;
481  $ilDB = $DIC['ilDB'];
482 
483  $result = $ilDB->queryF(
484  "SELECT obj_fi FROM tst_tests WHERE test_id = %s",
485  ['integer'],
486  [$a_test_id]
487  );
488 
489  $row = $ilDB->fetchAssoc($result);
490  return $row["obj_fi"];
491  }
492 
500  public static function _getRandomTestsForQuestionPool($qpl_id): array
501  {
502  global $DIC;
503  $ilDB = $DIC['ilDB'];
504 
505  $query = "
506  SELECT DISTINCT t.obj_fi
507  FROM tst_tests t
508  INNER JOIN tst_rnd_quest_set_qpls r
509  ON t.test_id = r.test_fi
510  WHERE r.pool_fi = %s
511  ";
512 
513  $result = $ilDB->queryF($query, ['integer'], [$qpl_id]);
514 
515  $tests = [];
516  while ($row = $ilDB->fetchAssoc($result)) {
517  $tests[] = $row['obj_fi'];
518  }
519 
520  return $tests;
521  }
522  // fim.
523 
530  public static function _lookupOnlineTestAccess($a_test_id, $a_user_id)
531  {
532  global $DIC;
533  $ilDB = $DIC['ilDB'];
534  $lng = $DIC['lng'];
535 
536  $result = $ilDB->queryF(
537  "SELECT tst_tests.* FROM tst_tests WHERE tst_tests.obj_fi = %s",
538  ['integer'],
539  [$a_test_id]
540  );
541  if ($result->numRows()) {
542  $row = $ilDB->fetchAssoc($result);
543  if ($row["fixed_participants"]) {
544  $result = $ilDB->queryF(
545  "SELECT * FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
546  ['integer','integer'],
547  [$row["test_id"], $a_user_id]
548  );
549  if ($result->numRows()) {
550  $row = $ilDB->fetchAssoc($result);
551  if ($row['clientip'] !== null && trim($row['clientip']) != "") {
552  $row['clientip'] = preg_replace("/[^0-9.?*,:]+/", "", $row['clientip']);
553  $row['clientip'] = str_replace(".", "\\.", $row['clientip']);
554  $row['clientip'] = str_replace(["?","*",","], ["[0-9]","[0-9]*","|"], $row['clientip']);
555  if (!preg_match("/^" . $row['clientip'] . "$/", $_SERVER["REMOTE_ADDR"])) {
556  $lng->loadLanguageModule('assessment');
557  return $lng->txt("user_wrong_clientip");
558  } else {
559  return true;
560  }
561  } else {
562  return true;
563  }
564  } else {
565  return $lng->txt("tst_user_not_invited");
566  }
567  } else {
568  return true;
569  }
570  } else {
571  return true;
572  }
573  }
574 
582  public static function _getParticipantData($active_id): string
583  {
584  global $DIC;
585  $lng = $DIC['lng'];
586  $ilDB = $DIC['ilDB'];
587 
588  $result_active = $ilDB->queryF(
589  'SELECT * FROM tst_active WHERE active_id = %s',
590  ['integer'],
591  [$active_id]
592  );
593  $row_active = $ilDB->fetchAssoc($result_active);
594  $importname = $row_active['importname'];
595 
596  if ($importname !== null
597  && $importname !== '') {
598  return $importname . ' (' . $lng->txt('imported') . ')';
599  }
600 
601  if ($row_active['user_fi'] === ANONYMOUS_USER_ID) {
602  return '';
603  }
604 
605  $uname = ilObjUser::_lookupName($row_active['user_fi']);
606 
607  $result_test = $ilDB->queryF(
608  "SELECT obj_fi FROM tst_tests WHERE test_id = %s",
609  ["integer"],
610  [$row_active['test_fi']]
611  );
612  $row_test = $ilDB->fetchAssoc($result_test);
613  $obj_id = $row_test["obj_fi"];
614 
615  if (ilObjTest::_lookupAnonymity($obj_id)) {
616  return $lng->txt("anonymous");
617  }
618 
619  if ($uname['firstname'] . $uname['lastname'] === '') {
620  return $lng->txt('deleted_user');
621  }
622 
623  return trim($uname['lastname'] . ', ' . $uname['firstname']);
624  }
625 
632  public static function _getParticipantId($active_id): int
633  {
634  global $DIC;
635  $lng = $DIC['lng'];
636  $ilDB = $DIC['ilDB'];
637 
638  $result = $ilDB->queryF(
639  "SELECT user_fi FROM tst_active WHERE active_id = %s",
640  ["integer"],
641  [$active_id]
642  );
643  $row = $ilDB->fetchAssoc($result);
644  return $row["user_fi"];
645  }
646 
647 
662  public static function _getPassedUsers($a_obj_id): array
663  {
664  global $DIC;
665  $ilDB = $DIC['ilDB'];
666 
667  $passed_users = [];
668  // Maybe SELECT DISTINCT(tst_active.user_fi)... ?
669  $userresult = $ilDB->queryF(
670  "
671  SELECT tst_active.active_id, COUNT(tst_sequence.active_fi) sequences, tst_active.last_finished_pass,
672  CASE WHEN
673  (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass
674  THEN '1'
675  ELSE '0'
676  END is_last_pass
677  FROM tst_tests
678  INNER JOIN tst_active
679  ON tst_active.test_fi = tst_tests.test_id
680  LEFT JOIN tst_sequence
681  ON tst_sequence.active_fi = tst_active.active_id
682  WHERE tst_tests.obj_fi = %s
683  GROUP BY tst_active.active_id
684  ",
685  ['integer'],
686  [$a_obj_id]
687  );
688  $all_participants = [];
689  $notAttempted = [];
690  $lastPassUsers = [];
691  while ($row = $ilDB->fetchAssoc($userresult)) {
692  if ($row['sequences'] == 0) {
693  $notAttempted[$row['active_id']] = $row['active_id'];
694  }
695  if ($row['is_last_pass']) {
696  $lastPassUsers[$row['active_id']] = $row['active_id'];
697  }
698 
699  $all_participants[$row['active_id']] = $row['active_id'];
700  }
701 
702  $result = $ilDB->query("SELECT tst_result_cache.*, tst_active.user_fi FROM tst_result_cache, tst_active WHERE tst_active.active_id = tst_result_cache.active_fi AND " . $ilDB->in('active_fi', $all_participants, false, 'integer'));
703  $found_all = ($result->numRows() == count($all_participants)) ? true : false;
704  if (!$found_all) {
705  $test = new ilObjTest($a_obj_id, false);
706  // if the result cache entries do not exist, create them
707  $found_participants = [];
708  while ($data = $ilDB->fetchAssoc($result)) {
709  array_push($found_participants, $data['active_fi']);
710  }
711  foreach ($all_participants as $active_id) {
712  if (!in_array($active_id, $found_participants)) {
713  $test->updateTestResultCache($active_id);
714  }
715  }
716  $result = $ilDB->query("SELECT tst_result_cache.*, tst_active.user_fi FROM tst_result_cache, tst_active WHERE tst_active.active_id = tst_result_cache.active_fi AND " . $ilDB->in('active_fi', $all_participants, false, 'integer'));
717  }
718  while ($data = $ilDB->fetchAssoc($result)) {
719  if (isset($notAttempted[$data['active_fi']])) {
720  $data['failed'] = 0;
721  $data['passed'] = 0;
722  $data['not_attempted'] = 1;
723  }
724 
725  $data['user_id'] = $data['user_fi'];
726  array_push($passed_users, $data);
727  }
728  return $passed_users;
729  }
730 
734  public static function _checkGoto(string $target): bool
735  {
736  global $DIC;
737  $ilAccess = $DIC['ilAccess'];
738 
739  $t_arr = explode("_", $target);
740 
741  if ($t_arr[0] != "tst" || ((int) $t_arr[1]) <= 0) {
742  return false;
743  }
744 
745  if ($ilAccess->checkAccess("read", "", (int) $t_arr[1]) ||
746  $ilAccess->checkAccess("visible", "", (int) $t_arr[1])) {
747  return true;
748  }
749  return false;
750  }
751 
757  public static function _isOffline(int $obj_id): bool
758  {
759  return ilObject::lookupOfflineStatus($obj_id);
760  }
761 
762 
763  public static function visibleUserResultExists($test_obj_id, $user_id): bool
764  {
765  global $DIC;
766  $ilDB = $DIC['ilDB'];
767  $ilUser = $DIC['ilUser'];
768 
769  $test_obj = ilObjectFactory::getInstanceByObjId($test_obj_id, false);
770 
771  if (!($test_obj instanceof ilObjTest)) {
772  return false;
773  }
774 
775  $test_session_factory = new ilTestSessionFactory($test_obj, $ilDB, $ilUser);
776  $test_session = $test_session_factory->getSessionByUserId($user_id);
777 
778  return $test_obj->canShowTestResults($test_session);
779  }
780 }
static _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the test are given
$res
Definition: ltiservices.php:69
static _getParticipantData($active_id)
Retrieves a participant name from active id.
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _getParticipantId($active_id)
Get user id for active id.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
except(callable $f)
Feed the error into a callable and replace this with the result or do nothing if this is a value...
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Result.php:14
static _lookupName(int $a_user_id)
lookup user name
Interface for condition handling.
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _isPassed($user_id, $a_obj_id)
Returns TRUE if the user with the user id $user_id passed the test with the object id $a_obj_id...
static _lookupAnonymity($a_obj_id)
ilAccessHandler $access
$path
Definition: ltiservices.php:32
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
global $DIC
Definition: feed.php:28
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
static _getRandomTestsForQuestionPool($qpl_id)
Get all tests using a question pool for random selection.
static _lookupObjIdForTestId($a_test_id)
Lookup object id for test id.
$ref_id
Definition: ltiauth.php:67
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, int $user_id=null)
Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcce...
__construct(VocabulariesInterface $vocabularies)
canBeDelivered(ilWACPath $ilWACPath)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
static _getPassedUsers($a_obj_id)
Returns an array containing the users who passed the test.
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
static isFailed($user_id, $a_obj_id)
Returns TRUE if the user with the user id $user_id failed the test with the object id $a_obj_id...
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition
findMatch(string $path, array $array)
Class ilObjTestAccess.
static _checkGoto(string $target)
check whether goto script will succeed
static getConditionOperators()
Get possible conditions operators.
static _isOffline(int $obj_id)
returns the objects&#39;s OFFline status
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static updateTestResultCache($a_user_id, $a_obj_id)
static visibleUserResultExists($test_obj_id, $user_id)