ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjTestAccess.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "./Services/Object/classes/class.ilObjectAccess.php";
5 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
6 include_once './Services/AccessControl/interfaces/interface.ilConditionHandling.php';
7 
21 {
37  function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
38  {
39  global $ilUser, $lng, $rbacsystem, $ilAccess;
40 
41  if ($a_user_id == "")
42  {
43  $a_user_id = $ilUser->getId();
44  }
45 
46  $is_admin = $rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id);
47 
48  // check "global" online switch
49  if(!self::_isOnline($a_obj_id) && !$is_admin)
50  {
51  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
52  return false;
53  }
54 
55  switch ($a_permission)
56  {
57  case "visible":
58  case "read":
60  !$is_admin)
61  {
62  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("tst_warning_test_not_complete"));
63  return false;
64  }
65  break;
66  }
67 
68  switch ($a_cmd)
69  {
70  case "eval_a":
71  case "eval_stat":
73  {
74  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("tst_warning_test_not_complete"));
75  return false;
76  }
77  break;
78 
79  }
80 
81  return true;
82  }
83 
91  public static function _isPassed($user_id, $a_obj_id)
92  {
93  global $ilDB;
94  $result = $ilDB->queryF("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",
95  array('integer','integer'),
96  array($user_id, $a_obj_id)
97  );
98  if (!$result->numRows())
99  {
100  $result = $ilDB->queryF("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",
101  array('integer','integer'),
102  array($user_id, $a_obj_id)
103  );
104  $row = $ilDB->fetchAssoc($result);
105  if ($row['active_id'] > 0)
106  {
107  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
109  }
110  else
111  {
112  return false;
113  }
114  }
115  $result = $ilDB->queryF("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",
116  array('integer','integer'),
117  array($user_id, $a_obj_id)
118  );
119  if (!$result->numRows())
120  {
121  $result = $ilDB->queryF("SELECT tst_pass_result.*, tst_tests.pass_scoring, tst_tests.random_test, 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",
122  array('integer','integer'),
123  array($user_id, $a_obj_id)
124  );
125  $points = array();
126  while ($row = $ilDB->fetchAssoc($result))
127  {
128  array_push($points, $row);
129  }
130  $reached = 0;
131  $max = 0;
132  if ($points[0]["pass_scoring"] == 0)
133  {
134  $reached = $points[count($points)-1]["points"];
135  $max = $points[count($points)-1]["maxpoints"];
136  if (!$max)
137  {
138  $active_id = $points[count($points)-1]["active_fi"];
139  $pass = $points[count($points)-1]["pass"];
140  if (strlen($active_id) && strlen($pass))
141  {
142  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
143  $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
144  $max = $res['maxpoints'];
145  $reached = $res['points'];
146  }
147  }
148  }
149  else
150  {
151  foreach ($points as $row)
152  {
153  if ($row["points"] > $reached)
154  {
155  $reached = $row["points"];
156  $max = $row["maxpoints"];
157  if (!$max)
158  {
159  $active_id = $row["active_fi"];
160  $pass = $row["pass"];
161  if (strlen($active_id) && strlen($pass))
162  {
163  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
164  $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
165  $max = $res['maxpoints'];
166  $reached = $res['points'];
167  }
168  }
169  }
170  }
171  }
172  include_once "./Modules/Test/classes/class.assMarkSchema.php";
173  $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
174  $mark = ASS_MarkSchema::_getMatchingMarkFromObjId($a_obj_id, $percentage);
175  return ($mark["passed"]) ? TRUE : FALSE;
176  }
177  else
178  {
179  $row = $ilDB->fetchAssoc($result);
180  return ($row['passed']) ? true : false;
181  }
182  }
183 
191  public static function isFailed($user_id, $a_obj_id)
192  {
193  global $ilDB;
194 
195  $ret = self::updateTestResultCache($user_id, $a_obj_id);
196 
197  if(!$ret)
198  {
199  return false;
200  }
201 
202  $result = $ilDB->queryF("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",
203  array('integer','integer'),
204  array($user_id, $a_obj_id)
205  );
206 
207  if (!$result->numRows())
208  {
209  $result = $ilDB->queryF("SELECT tst_pass_result.*, tst_tests.pass_scoring, tst_tests.random_test, 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",
210  array('integer','integer'),
211  array($user_id, $a_obj_id)
212  );
213 
214  while ($row = $ilDB->fetchAssoc($result))
215  {
216  array_push($points, $row);
217  }
218  $reached = 0;
219  $max = 0;
220  if ($points[0]["pass_scoring"] == 0)
221  {
222  $reached = $points[count($points)-1]["points"];
223  $max = $points[count($points)-1]["maxpoints"];
224  if (!$max)
225  {
226  $active_id = $points[count($points)-1]["active_fi"];
227  $pass = $points[count($points)-1]["pass"];
228  if (strlen($active_id) && strlen($pass))
229  {
230  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
231  $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
232  $max = $res['maxpoints'];
233  $reached = $res['points'];
234  }
235  }
236  }
237  else
238  {
239  foreach ($points as $row)
240  {
241  if ($row["points"] > $reached)
242  {
243  $reached = $row["points"];
244  $max = $row["maxpoints"];
245  if (!$max)
246  {
247  $active_id = $row["active_fi"];
248  $pass = $row["pass"];
249  if (strlen($active_id) && strlen($pass))
250  {
251  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
252  $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
253  $max = $res['maxpoints'];
254  $reached = $res['points'];
255  }
256  }
257  }
258  }
259  }
260  include_once "./Modules/Test/classes/class.assMarkSchema.php";
261  $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
262  $mark = ASS_MarkSchema::_getMatchingMarkFromObjId($a_obj_id, $percentage);
263  return ($mark["failed"]) ? TRUE : FALSE;
264  }
265  else
266  {
267  $row = $ilDB->fetchAssoc($result);
268  return ($row['failed']) ? TRUE : FALSE;
269  }
270  }
271 
277  protected static function updateTestResultCache($a_user_id, $a_obj_id)
278  {
279  global $ilDB;
280 
281  $result = $ilDB->queryF(
282  "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests ".
283  "WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s ".
284  "AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
285  array('integer','integer'),
286  array($a_user_id, $a_obj_id)
287  );
288  if (!$result->numRows())
289  {
290  $result = $ilDB->queryF("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",
291  array('integer','integer'),
292  array($a_user_id, $a_obj_id)
293  );
294  $row = $ilDB->fetchAssoc($result);
295  if ($row['active_id'] > 0)
296  {
297  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
299  return true;
300  }
301  else
302  {
303  return false;
304  }
305 
306  }
307  else
308  {
309  return true;
310  }
311  }
312 
313 
317  public static function getConditionOperators()
318  {
319  include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
320  return array(
325  );
326  }
327 
328 
334  public static function checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
335  {
336  include_once './Services/AccessControl/classes/class.ilConditionHandler.php';
337 
338  switch($a_operator)
339  {
341  return ilObjTestAccess::_isPassed($a_usr_id, $a_obj_id);
342  break;
343 
345  return ilObjTestAccess::isFailed($a_usr_id, $a_obj_id);
346 
348  return ilObjTestAccess::hasFinished($a_usr_id,$a_obj_id);
349 
351  return !ilObjTestAccess::hasFinished($a_usr_id,$a_obj_id);
352 
353  default:
354  return true;
355  }
356  return true;
357  }
358 
371  static function _getCommands()
372  {
373  $commands = array
374  (
375  array("permission" => "write", "cmd" => "questionsTabGateway", "lang_var" => "tst_edit_questions"),
376  array("permission" => "write", "cmd" => "ilObjTestSettingsGeneralGUI::showForm", "lang_var" => "settings"),
377  array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "tst_run",
378  "default" => true),
379  //array("permission" => "write", "cmd" => "", "lang_var" => "edit"),
380  array("permission" => "tst_statistics", "cmd" => "outEvaluation", "lang_var" => "tst_statistical_evaluation"),
381  array("permission" => "read", "cmd" => "userResultsGateway", "lang_var" => "tst_test_results")
382  );
383 
384  return $commands;
385  }
386 
387  //
388  // object specific access related methods
389  //
390 
394  public static function _lookupCreationComplete($a_obj_id)
395  {
396  global $ilDB;
397 
398  $result = $ilDB->queryF("SELECT complete FROM tst_tests WHERE obj_fi=%s",
399  array('integer'),
400  array($a_obj_id)
401  );
402  if ($result->numRows() == 1)
403  {
404  $row = $ilDB->fetchAssoc($result);
405  }
406 
407  return ($row['complete']) ? true : false;
408  }
409 
415  private static $hasFinishedCache = array();
416 
424  public static function hasFinished($a_user_id, $a_obj_id)
425  {
426  if( !isset(self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"]) )
427  {
428  require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
429  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
430  require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
431 
432  global $ilDB, $lng;
433 
434  $testOBJ = ilObjectFactory::getInstanceByObjId($a_obj_id);
435 
436  $partData = new ilTestParticipantData($ilDB, $lng);
437  $partData->setUserIds(array($a_user_id));
438  $partData->load($testOBJ->getTestId());
439 
440  $activeId = $partData->getActiveIdByUserId($a_user_id);
441 
442  $testSessionFactory = new ilTestSessionFactory($testOBJ);
443  $testSession = $testSessionFactory->getSession($activeId);
444 
445  $testPassesSelector = new ilTestPassesSelector($ilDB, $testOBJ);
446  $testPassesSelector->setActiveId($activeId);
447  $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
448 
449  self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"] = count($testPassesSelector->getClosedPasses());
450  }
451 
452  return (bool) self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"];
453  }
454 
462  public static function _getTestIDFromObjectID($object_id)
463  {
464  global $ilDB;
465  $test_id = FALSE;
466  $result = $ilDB->queryF("SELECT test_id FROM tst_tests WHERE obj_fi = %s",
467  array('integer'),
468  array($object_id)
469  );
470  if ($result->numRows())
471  {
472  $row = $ilDB->fetchAssoc($result);
473  $test_id = $row["test_id"];
474  }
475  return $test_id;
476  }
477 
484  public static function _lookupObjIdForTestId($a_test_id)
485  {
486  global $ilDB;
487 
488  $result = $ilDB->queryF("SELECT obj_fi FROM tst_tests WHERE test_id = %s",
489  array('integer'),
490  array($a_test_id)
491  );
492 
493  $row = $ilDB->fetchAssoc($result);
494  return $row["obj_fi"];
495  }
496 
504  public static function _getRandomTestsForQuestionPool($qpl_id)
505  {
506  global $ilDB;
507 
508  $query = "
509  SELECT DISTINCT t.obj_fi
510  FROM tst_tests t
511  INNER JOIN tst_rnd_quest_set_qpls r
512  ON t.test_id = r.test_fi
513  WHERE r.pool_fi = %s
514  ";
515 
516  $result = $ilDB->queryF($query, array('integer'), array($qpl_id));
517 
518  $tests = array();
519  while ($row = $ilDB->fetchAssoc($result))
520  {
521  $tests[] = $row['obj_fi'];
522  }
523 
524  return $tests;
525  }
526  // fim.
527 
534  public static function _lookupOnlineTestAccess($a_test_id, $a_user_id)
535  {
536  global $ilDB, $lng;
537 
538  $result = $ilDB->queryF("SELECT tst_tests.* FROM tst_tests WHERE tst_tests.obj_fi = %s",
539  array('integer'),
540  array($a_test_id)
541  );
542  if ($result->numRows())
543  {
544  $row = $ilDB->fetchAssoc($result);
545  if ($row["fixed_participants"])
546  {
547  $result = $ilDB->queryF("SELECT * FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
548  array('integer','integer'),
549  array($row["test_id"], $a_user_id)
550  );
551  if ($result->numRows())
552  {
553  $row = $ilDB->fetchAssoc($result);
554  if (trim($row['clientip']) != "")
555  {
556  $row['clientip'] = preg_replace("/[^0-9.?*,:]+/","",$row['clientip']);
557  $row['clientip'] = str_replace(".","\\.",$row['clientip']);
558  $row['clientip'] = str_replace(Array("?","*",","), Array("[0-9]","[0-9]*","|"), $row['clientip']);
559  if (!preg_match("/^".$row['clientip']."$/", $_SERVER["REMOTE_ADDR"]))
560  {
561  return $lng->txt("tst_user_wrong_clientip");
562  }
563  else
564  {
565  return true;
566  }
567  }
568  else
569  {
570  return true;
571  }
572  }
573  else
574  {
575  return $lng->txt("tst_user_not_invited");
576  }
577  }
578  else
579  {
580  return true;
581  }
582  }
583  else
584  {
585  return true;
586  }
587  }
588 
596  public static function _getParticipantData($active_id)
597  {
598  global $lng, $ilDB;
599 
600  $result = $ilDB->queryF("SELECT * FROM tst_active WHERE active_id = %s",
601  array("integer"),
602  array($active_id)
603  );
604  $row = $ilDB->fetchAssoc($result);
605  $user_id = $row["user_fi"];
606  $test_id = $row["test_fi"];
607  $importname = $row['importname'];
608 
609  $result = $ilDB->queryF("SELECT obj_fi FROM tst_tests WHERE test_id = %s",
610  array("integer"),
611  array($test_id)
612  );
613  $row = $ilDB->fetchAssoc($result);
614  $obj_id = $row["obj_fi"];
615 
616  include_once "./Modules/Test/classes/class.ilObjTest.php";
617  $is_anonymous = ilObjTest::_lookupAnonymity($obj_id);
618 
619  include_once './Services/User/classes/class.ilObjUser.php';
620  $uname = ilObjUser::_lookupName($user_id);
621 
622  $name = "";
623  if (strlen($importname))
624  {
625  $name = $importname . ' (' . $lng->txt('imported') . ')';
626  }
627  else if (strlen($uname["firstname"].$uname["lastname"]) == 0)
628  {
629  $name = $lng->txt("deleted_user");
630  }
631  else
632  {
633  if ($user_id == ANONYMOUS_USER_ID)
634  {
635  $name = $lastname;
636  }
637  else
638  {
639  $name = trim($uname["lastname"] . ", " . $uname["firstname"] . " " . $uname["title"]);
640  }
641  if ($is_anonymous)
642  {
643  $name = $lng->txt("anonymous");
644  }
645  }
646  return $name;
647  }
648 
655  public static function _getParticipantId($active_id)
656  {
657  global $lng, $ilDB;
658 
659  $result = $ilDB->queryF("SELECT user_fi FROM tst_active WHERE active_id = %s",
660  array("integer"),
661  array($active_id)
662  );
663  $row = $ilDB->fetchAssoc($result);
664  return $row["user_fi"];
665  }
666 
667 
682  public static function _getPassedUsers($a_obj_id)
683  {
684  global $ilDB;
685 
686  $passed_users = array();
687  // Maybe SELECT DISTINCT(tst_active.user_fi)... ?
688  $userresult = $ilDB->queryF("
689  SELECT tst_active.active_id, COUNT(tst_sequence.active_fi) sequences, tst_active.last_finished_pass,
690  CASE WHEN
691  (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass
692  THEN '1'
693  ELSE '0'
694  END is_last_pass
695  FROM tst_tests
696  INNER JOIN tst_active
697  ON tst_active.test_fi = tst_tests.test_id
698  LEFT JOIN tst_sequence
699  ON tst_sequence.active_fi = tst_active.active_id
700  WHERE tst_tests.obj_fi = %s
701  GROUP BY tst_active.active_id
702  ",
703  array('integer'), array($a_obj_id)
704  );
705  $all_participants = array();
706  $notAttempted = array();
707  $lastPassUsers = array();
708  while ($row = $ilDB->fetchAssoc($userresult))
709  {
710  if($row['sequences'] == 0)
711  {
712  $notAttempted[$row['active_id']] = $row['active_id'];
713  }
714  if($row['is_last_pass'])
715  {
716  $lastPassUsers[$row['active_id']] = $row['active_id'];
717  }
718 
719  $all_participants[$row['active_id']] = $row['active_id'];
720  }
721 
722  $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'));
723  $found_all = ($result->numRows() == count($all_participants)) ? true : false;
724  if (!$found_all)
725  {
726  // if the result cache entries do not exist, create them
727  $found_participants = array();
728  while ($data = $ilDB->fetchAssoc($result))
729  {
730  array_push($found_participants, $data['active_fi']);
731  }
732  foreach ($all_participants as $active_id)
733  {
734  if (!in_array($active_id, $found_participants))
735  {
736  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
738  }
739  }
740  $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'));
741  }
742  while ($data = $ilDB->fetchAssoc($result))
743  {
744  if( isset($notAttempted[$data['active_fi']]) )
745  {
746  $data['failed'] = 0;
747  $data['passed'] = 0;
748  $data['not_attempted'] = 1;
749  }
750 
751  if( $data['failed'] && !isset($lastPassUsers[$data['active_fi']]) )
752  {
753  $data['passed'] = 0;
754  $data['failed'] = 0;
755  $data['in_progress'] = 1;
756  }
757 
758  $data['user_id'] = $data['user_fi'];
759  array_push($passed_users, $data);
760  }
761  return $passed_users;
762  }
763 
767  static function _checkGoto($a_target)
768  {
769  global $ilAccess;
770 
771  $t_arr = explode("_", $a_target);
772 
773  if ($t_arr[0] != "tst" || ((int) $t_arr[1]) <= 0)
774  {
775  return false;
776  }
777 
778  if ($ilAccess->checkAccess("read", "", $t_arr[1]))
779  {
780  return true;
781  }
782  return false;
783  }
784 
793  static function _isOffline($a_obj_id)
794  {
795 // global $ilUser;
796 // return (self::_lookupOnlineTestAccess($a_obj_id, $ilUser->getId()) !== true) ||
797 // (!ilObjTestAccess::_lookupCreationComplete($a_obj_id));
798  return !self::_isOnline($a_obj_id);
799  }
800 
807  public static function _isOnline($a_obj_id)
808  {
809  global $ilDB;
810 
811  $query = "
812  SELECT test_id
813  FROM tst_tests
814  WHERE obj_fi = %s
815  AND online_status = 1
816  ";
817 
818  $result = $ilDB->queryF( $query, array('integer'), array($a_obj_id) );
819 
820  return $result->numRows() == 1;
821  }
822 
823  public static function visibleUserResultExists($testObjId, $userId)
824  {
825  $testOBJ = ilObjectFactory::getInstanceByObjId($testObjId, false);
826 
827  if( !($testOBJ instanceof ilObjTest) )
828  {
829  return false;
830  }
831 
832  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
833  $testSessionFactory = new ilTestSessionFactory($testOBJ);
834  $testSession = $testSessionFactory->getSessionByUserId($userId);
835 
836  return $testOBJ->canShowTestResults($testSession);
837  }
838 
846  public static function hasVisibleCertificate($testObjId, $userId)
847  {
848  $testOBJ = ilObjectFactory::getInstanceByObjId($testObjId, false);
849 
850  if( !($testOBJ instanceof ilObjTest) || !$userId )
851  {
852  return false;
853  }
854 
855  require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
856  $testSessionFactory = new ilTestSessionFactory($testOBJ);
857  $testSession = $testSessionFactory->getSessionByUserId($userId);
858 
859  if( !$testSession->getActiveId() )
860  {
861  return false;
862  }
863 
864  return $testOBJ->canShowCertificate($testSession, $testSession->getUserId(), $testSession->getActiveId());
865  }
866 }
static _lookupName($a_user_id)
lookup user name
static _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the test are given
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
Move this to a proper place.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static _getParticipantData($active_id)
Retrieves a participant name from active id.
static _getParticipantId($active_id)
Get user id for active id.
$result
const IL_NO_OBJECT_ACCESS
Interface for condition handling.
static _isOffline($a_obj_id)
returns the objects&#39;s OFFline status
static _isOnline($a_obj_id)
returns the objects&#39;s ONline status
_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::checkAcce...
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)
Returns the anonymity status of a test with a given object id.
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.
static _getMatchingMarkFromObjId($a_obj_id, $percentage)
Returns the matching mark for a given percentage.
static visibleUserResultExists($testObjId, $userId)
$ilUser
Definition: imgupload.php:18
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 hasVisibleCertificate($testObjId, $userId)
Andre Michels amichels@databay.de
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 getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjTestAccess.
Create styles array
The data for the language used.
static getConditionOperators()
Get possible conditions operators.
static updateTestResultCache($a_user_id, $a_obj_id)
Update test result cache.
Class ilObjectAccess.
global $lng
Definition: privfeed.php:17
global $ilDB
$ret
Definition: parser.php:6
static _getCommands()
get commands
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static hasFinished($a_user_id, $a_obj_id)
Returns (request cached) information if a specific user has finished at least one test pass...
static _checkGoto($a_target)
check whether goto script will succeed