ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
4include_once "./Services/Object/classes/class.ilObjectAccess.php";
5include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
6include_once './Services/Conditions/interfaces/interface.ilConditionHandling.php';
7
21{
37 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
38 {
39 global $DIC;
40 $ilUser = $DIC['ilUser'];
41 $lng = $DIC['lng'];
42 $rbacsystem = $DIC['rbacsystem'];
43 $ilAccess = $DIC['ilAccess'];
44
45 if ($a_user_id == "") {
46 $a_user_id = $ilUser->getId();
47 }
48
49 $is_admin = $rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id);
50
51
52 switch ($a_permission) {
53 case "visible":
54 case "read":
56 !$is_admin) {
57 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("tst_warning_test_not_complete"));
58 return false;
59 }
60 break;
61 }
62
63 switch ($a_cmd) {
64 case "eval_a":
65 case "eval_stat":
67 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("tst_warning_test_not_complete"));
68 return false;
69 }
70 break;
71
72 }
73
74 return true;
75 }
76
84 public static function _isPassed($user_id, $a_obj_id)
85 {
86 global $DIC;
87 $ilDB = $DIC['ilDB'];
88 $result = $ilDB->queryF(
89 "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",
90 array('integer','integer'),
91 array($user_id, $a_obj_id)
92 );
93 if (!$result->numRows()) {
94 $result = $ilDB->queryF(
95 "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",
96 array('integer','integer'),
97 array($user_id, $a_obj_id)
98 );
99 $row = $ilDB->fetchAssoc($result);
100 if ($row['active_id'] > 0) {
101 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
103 } else {
104 return false;
105 }
106 }
107 $result = $ilDB->queryF(
108 "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",
109 array('integer','integer'),
110 array($user_id, $a_obj_id)
111 );
112 if (!$result->numRows()) {
113 $result = $ilDB->queryF(
114 "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",
115 array('integer','integer'),
116 array($user_id, $a_obj_id)
117 );
118 $points = array();
119 while ($row = $ilDB->fetchAssoc($result)) {
120 array_push($points, $row);
121 }
122 $reached = 0;
123 $max = 0;
124 if ($points[0]["pass_scoring"] == 0) {
125 $reached = $points[count($points) - 1]["points"];
126 $max = $points[count($points) - 1]["maxpoints"];
127 if (!$max) {
128 $active_id = $points[count($points) - 1]["active_fi"];
129 $pass = $points[count($points) - 1]["pass"];
130 if (strlen($active_id) && strlen($pass)) {
131 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
132 $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
133 $max = $res['maxpoints'];
134 $reached = $res['points'];
135 }
136 }
137 } else {
138 foreach ($points as $row) {
139 if ($row["points"] > $reached) {
140 $reached = $row["points"];
141 $max = $row["maxpoints"];
142 if (!$max) {
143 $active_id = $row["active_fi"];
144 $pass = $row["pass"];
145 if (strlen($active_id) && strlen($pass)) {
146 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
147 $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
148 $max = $res['maxpoints'];
149 $reached = $res['points'];
150 }
151 }
152 }
153 }
154 }
155 include_once "./Modules/Test/classes/class.assMarkSchema.php";
156 $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
157 $mark = ASS_MarkSchema::_getMatchingMarkFromObjId($a_obj_id, $percentage);
158 return ($mark["passed"]) ? true : false;
159 } else {
160 $row = $ilDB->fetchAssoc($result);
161 return ($row['passed']) ? true : false;
162 }
163 }
164
172 public static function isFailed($user_id, $a_obj_id)
173 {
174 global $DIC;
175 $ilDB = $DIC['ilDB'];
176
177 $ret = self::updateTestResultCache($user_id, $a_obj_id);
178
179 if (!$ret) {
180 return false;
181 }
182
183 $result = $ilDB->queryF(
184 "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",
185 array('integer','integer'),
186 array($user_id, $a_obj_id)
187 );
188
189 if (!$result->numRows()) {
190 $result = $ilDB->queryF(
191 "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",
192 array('integer','integer'),
193 array($user_id, $a_obj_id)
194 );
195
196 while ($row = $ilDB->fetchAssoc($result)) {
197 array_push($points, $row);
198 }
199 $reached = 0;
200 $max = 0;
201 if ($points[0]["pass_scoring"] == 0) {
202 $reached = $points[count($points) - 1]["points"];
203 $max = $points[count($points) - 1]["maxpoints"];
204 if (!$max) {
205 $active_id = $points[count($points) - 1]["active_fi"];
206 $pass = $points[count($points) - 1]["pass"];
207 if (strlen($active_id) && strlen($pass)) {
208 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
209 $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
210 $max = $res['maxpoints'];
211 $reached = $res['points'];
212 }
213 }
214 } else {
215 foreach ($points as $row) {
216 if ($row["points"] > $reached) {
217 $reached = $row["points"];
218 $max = $row["maxpoints"];
219 if (!$max) {
220 $active_id = $row["active_fi"];
221 $pass = $row["pass"];
222 if (strlen($active_id) && strlen($pass)) {
223 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
224 $res = assQuestion::_updateTestPassResults($active_id, $pass, null, $a_obj_id);
225 $max = $res['maxpoints'];
226 $reached = $res['points'];
227 }
228 }
229 }
230 }
231 }
232 include_once "./Modules/Test/classes/class.assMarkSchema.php";
233 $percentage = (!$max) ? 0 : ($reached / $max) * 100.0;
234 $mark = ASS_MarkSchema::_getMatchingMarkFromObjId($a_obj_id, $percentage);
235 return ($mark["failed"]) ? true : false;
236 } else {
237 $row = $ilDB->fetchAssoc($result);
238 return ($row['failed']) ? true : false;
239 }
240 }
241
247 protected static function updateTestResultCache($a_user_id, $a_obj_id)
248 {
249 global $DIC;
250 $ilDB = $DIC['ilDB'];
251
252 $result = $ilDB->queryF(
253 "SELECT tst_result_cache.* FROM tst_result_cache, tst_active, tst_tests " .
254 "WHERE tst_active.test_fi = tst_tests.test_id AND tst_active.user_fi = %s " .
255 "AND tst_tests.obj_fi = %s AND tst_result_cache.active_fi = tst_active.active_id",
256 array('integer','integer'),
257 array($a_user_id, $a_obj_id)
258 );
259 if (!$result->numRows()) {
260 $result = $ilDB->queryF(
261 "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",
262 array('integer','integer'),
263 array($a_user_id, $a_obj_id)
264 );
265 $row = $ilDB->fetchAssoc($result);
266 if ($row['active_id'] > 0) {
267 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
269 return true;
270 } else {
271 return false;
272 }
273 } else {
274 return true;
275 }
276 }
277
278
282 public static function getConditionOperators()
283 {
284 include_once './Services/Conditions/classes/class.ilConditionHandler.php';
285 return array(
290 );
291 }
292
293
299 public static function checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
300 {
301 include_once './Services/Conditions/classes/class.ilConditionHandler.php';
302
303 switch ($a_operator) {
305 return ilObjTestAccess::_isPassed($a_usr_id, $a_obj_id);
306 break;
307
309 return ilObjTestAccess::isFailed($a_usr_id, $a_obj_id);
310
312 return ilObjTestAccess::hasFinished($a_usr_id, $a_obj_id);
313
315 return !ilObjTestAccess::hasFinished($a_usr_id, $a_obj_id);
316
317 default:
318 return true;
319 }
320 return true;
321 }
322
335 public static function _getCommands()
336 {
337 $commands = array(
338 array("permission" => "write", "cmd" => "questionsTabGateway", "lang_var" => "tst_edit_questions"),
339 array("permission" => "write", "cmd" => "ilObjTestSettingsGeneralGUI::showForm", "lang_var" => "settings"),
340 array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "tst_run",
341 "default" => true),
342 //array("permission" => "write", "cmd" => "", "lang_var" => "edit"),
343 array("permission" => "tst_statistics", "cmd" => "outEvaluation", "lang_var" => "tst_statistical_evaluation"),
344 array("permission" => "read", "cmd" => "userResultsGateway", "lang_var" => "tst_test_results")
345 );
346
347 return $commands;
348 }
349
350 //
351 // object specific access related methods
352 //
353
357 public static function _lookupCreationComplete($a_obj_id)
358 {
359 global $DIC;
360 $ilDB = $DIC['ilDB'];
361
362 $result = $ilDB->queryF(
363 "SELECT complete FROM tst_tests WHERE obj_fi=%s",
364 array('integer'),
365 array($a_obj_id)
366 );
367 if ($result->numRows() == 1) {
368 $row = $ilDB->fetchAssoc($result);
369 }
370
371 return ($row['complete']) ? true : false;
372 }
373
379 private static $hasFinishedCache = array();
380
388 public static function hasFinished($a_user_id, $a_obj_id)
389 {
390 if (!isset(self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"])) {
391 require_once 'Modules/Test/classes/class.ilTestParticipantData.php';
392 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
393 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
394
395 global $DIC;
396 $ilDB = $DIC['ilDB'];
397 $lng = $DIC['lng'];
398
399 $testOBJ = ilObjectFactory::getInstanceByObjId($a_obj_id);
400
401 $partData = new ilTestParticipantData($ilDB, $lng);
402 $partData->setUserIdsFilter(array($a_user_id));
403 $partData->load($testOBJ->getTestId());
404
405 $activeId = $partData->getActiveIdByUserId($a_user_id);
406
407 $testSessionFactory = new ilTestSessionFactory($testOBJ);
408 $testSession = $testSessionFactory->getSession($activeId);
409
410 $testPassesSelector = new ilTestPassesSelector($ilDB, $testOBJ);
411 $testPassesSelector->setActiveId($activeId);
412 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
413
414 self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"] = count($testPassesSelector->getClosedPasses());
415 }
416
417 return (bool) self::$hasFinishedCache["{$a_user_id}:{$a_obj_id}"];
418 }
419
427 public static function _getTestIDFromObjectID($object_id)
428 {
429 global $DIC;
430 $ilDB = $DIC['ilDB'];
431 $test_id = false;
432 $result = $ilDB->queryF(
433 "SELECT test_id FROM tst_tests WHERE obj_fi = %s",
434 array('integer'),
435 array($object_id)
436 );
437 if ($result->numRows()) {
438 $row = $ilDB->fetchAssoc($result);
439 $test_id = $row["test_id"];
440 }
441 return $test_id;
442 }
443
450 public static function _lookupObjIdForTestId($a_test_id)
451 {
452 global $DIC;
453 $ilDB = $DIC['ilDB'];
454
455 $result = $ilDB->queryF(
456 "SELECT obj_fi FROM tst_tests WHERE test_id = %s",
457 array('integer'),
458 array($a_test_id)
459 );
460
461 $row = $ilDB->fetchAssoc($result);
462 return $row["obj_fi"];
463 }
464
472 public static function _getRandomTestsForQuestionPool($qpl_id)
473 {
474 global $DIC;
475 $ilDB = $DIC['ilDB'];
476
477 $query = "
478 SELECT DISTINCT t.obj_fi
479 FROM tst_tests t
480 INNER JOIN tst_rnd_quest_set_qpls r
481 ON t.test_id = r.test_fi
482 WHERE r.pool_fi = %s
483 ";
484
485 $result = $ilDB->queryF($query, array('integer'), array($qpl_id));
486
487 $tests = array();
488 while ($row = $ilDB->fetchAssoc($result)) {
489 $tests[] = $row['obj_fi'];
490 }
491
492 return $tests;
493 }
494 // fim.
495
502 public static function _lookupOnlineTestAccess($a_test_id, $a_user_id)
503 {
504 global $DIC;
505 $ilDB = $DIC['ilDB'];
506 $lng = $DIC['lng'];
507
508 $result = $ilDB->queryF(
509 "SELECT tst_tests.* FROM tst_tests WHERE tst_tests.obj_fi = %s",
510 array('integer'),
511 array($a_test_id)
512 );
513 if ($result->numRows()) {
514 $row = $ilDB->fetchAssoc($result);
515 if ($row["fixed_participants"]) {
516 $result = $ilDB->queryF(
517 "SELECT * FROM tst_invited_user WHERE test_fi = %s AND user_fi = %s",
518 array('integer','integer'),
519 array($row["test_id"], $a_user_id)
520 );
521 if ($result->numRows()) {
522 $row = $ilDB->fetchAssoc($result);
523 if (trim($row['clientip']) != "") {
524 $row['clientip'] = preg_replace("/[^0-9.?*,:]+/", "", $row['clientip']);
525 $row['clientip'] = str_replace(".", "\\.", $row['clientip']);
526 $row['clientip'] = str_replace(array("?","*",","), array("[0-9]","[0-9]*","|"), $row['clientip']);
527 if (!preg_match("/^" . $row['clientip'] . "$/", $_SERVER["REMOTE_ADDR"])) {
528 $lng->loadLanguageModule('assessment');
529 return $lng->txt("user_wrong_clientip");
530 } else {
531 return true;
532 }
533 } else {
534 return true;
535 }
536 } else {
537 return $lng->txt("tst_user_not_invited");
538 }
539 } else {
540 return true;
541 }
542 } else {
543 return true;
544 }
545 }
546
554 public static function _getParticipantData($active_id)
555 {
556 global $DIC;
557 $lng = $DIC['lng'];
558 $ilDB = $DIC['ilDB'];
559
560 $result = $ilDB->queryF(
561 "SELECT * FROM tst_active WHERE active_id = %s",
562 array("integer"),
563 array($active_id)
564 );
565 $row = $ilDB->fetchAssoc($result);
566 $user_id = $row["user_fi"];
567 $test_id = $row["test_fi"];
568 $importname = $row['importname'];
569
570 $result = $ilDB->queryF(
571 "SELECT obj_fi FROM tst_tests WHERE test_id = %s",
572 array("integer"),
573 array($test_id)
574 );
575 $row = $ilDB->fetchAssoc($result);
576 $obj_id = $row["obj_fi"];
577
578 include_once "./Modules/Test/classes/class.ilObjTest.php";
579 $is_anonymous = ilObjTest::_lookupAnonymity($obj_id);
580
581 include_once './Services/User/classes/class.ilObjUser.php';
582 $uname = ilObjUser::_lookupName($user_id);
583
584 $name = "";
585 if (strlen($importname)) {
586 $name = $importname . ' (' . $lng->txt('imported') . ')';
587 } elseif (strlen($uname["firstname"] . $uname["lastname"]) == 0) {
588 $name = $lng->txt("deleted_user");
589 } else {
590 if ($user_id == ANONYMOUS_USER_ID) {
591 $name = $lastname;
592 } else {
593 $name = trim($uname["lastname"] . ", " . $uname["firstname"] . " " . $uname["title"]);
594 }
595 if ($is_anonymous) {
596 $name = $lng->txt("anonymous");
597 }
598 }
599 return $name;
600 }
601
608 public static function _getParticipantId($active_id)
609 {
610 global $DIC;
611 $lng = $DIC['lng'];
612 $ilDB = $DIC['ilDB'];
613
614 $result = $ilDB->queryF(
615 "SELECT user_fi FROM tst_active WHERE active_id = %s",
616 array("integer"),
617 array($active_id)
618 );
619 $row = $ilDB->fetchAssoc($result);
620 return $row["user_fi"];
621 }
622
623
638 public static function _getPassedUsers($a_obj_id)
639 {
640 global $DIC;
641 $ilDB = $DIC['ilDB'];
642
643 $passed_users = array();
644 // Maybe SELECT DISTINCT(tst_active.user_fi)... ?
645 $userresult = $ilDB->queryF(
646 "
647 SELECT tst_active.active_id, COUNT(tst_sequence.active_fi) sequences, tst_active.last_finished_pass,
648 CASE WHEN
649 (tst_tests.nr_of_tries - 1) = tst_active.last_finished_pass
650 THEN '1'
651 ELSE '0'
652 END is_last_pass
653 FROM tst_tests
654 INNER JOIN tst_active
655 ON tst_active.test_fi = tst_tests.test_id
656 LEFT JOIN tst_sequence
657 ON tst_sequence.active_fi = tst_active.active_id
658 WHERE tst_tests.obj_fi = %s
659 GROUP BY tst_active.active_id
660 ",
661 array('integer'),
662 array($a_obj_id)
663 );
664 $all_participants = array();
665 $notAttempted = array();
666 $lastPassUsers = array();
667 while ($row = $ilDB->fetchAssoc($userresult)) {
668 if ($row['sequences'] == 0) {
669 $notAttempted[$row['active_id']] = $row['active_id'];
670 }
671 if ($row['is_last_pass']) {
672 $lastPassUsers[$row['active_id']] = $row['active_id'];
673 }
674
675 $all_participants[$row['active_id']] = $row['active_id'];
676 }
677
678 $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'));
679 $found_all = ($result->numRows() == count($all_participants)) ? true : false;
680 if (!$found_all) {
681 // if the result cache entries do not exist, create them
682 $found_participants = array();
683 while ($data = $ilDB->fetchAssoc($result)) {
684 array_push($found_participants, $data['active_fi']);
685 }
686 foreach ($all_participants as $active_id) {
687 if (!in_array($active_id, $found_participants)) {
688 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
690 }
691 }
692 $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'));
693 }
694 while ($data = $ilDB->fetchAssoc($result)) {
695 if (isset($notAttempted[$data['active_fi']])) {
696 $data['failed'] = 0;
697 $data['passed'] = 0;
698 $data['not_attempted'] = 1;
699 }
700
701 if ($data['failed'] && !isset($lastPassUsers[$data['active_fi']])) {
702 $data['passed'] = 0;
703 $data['failed'] = 0;
704 $data['in_progress'] = 1;
705 }
706
707 $data['user_id'] = $data['user_fi'];
708 array_push($passed_users, $data);
709 }
710 return $passed_users;
711 }
712
716 public static function _checkGoto($a_target)
717 {
718 global $DIC;
719 $ilAccess = $DIC['ilAccess'];
720
721 $t_arr = explode("_", $a_target);
722
723 if ($t_arr[0] != "tst" || ((int) $t_arr[1]) <= 0) {
724 return false;
725 }
726
727 if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
728 return true;
729 }
730 return false;
731 }
732
741 public static function _isOffline($a_obj_id)
742 {
743 // global $DIC;
744 // $ilUser = $DIC['ilUser'];
745 // return (self::_lookupOnlineTestAccess($a_obj_id, $ilUser->getId()) !== true) ||
746 // (!ilObjTestAccess::_lookupCreationComplete($a_obj_id));
747 return ilObject::lookupOfflineStatus($a_obj_id);
748 }
749
750
751 public static function visibleUserResultExists($testObjId, $userId)
752 {
753 $testOBJ = ilObjectFactory::getInstanceByObjId($testObjId, false);
754
755 if (!($testOBJ instanceof ilObjTest)) {
756 return false;
757 }
758
759 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
760 $testSessionFactory = new ilTestSessionFactory($testOBJ);
761 $testSession = $testSessionFactory->getSessionByUserId($userId);
762
763 return $testOBJ->canShowTestResults($testSession);
764 }
765
773 public static function hasVisibleCertificate($testObjId, $userId)
774 {
775 $testOBJ = ilObjectFactory::getInstanceByObjId($testObjId, false);
776
777 if (!($testOBJ instanceof ilObjTest) || !$userId) {
778 return false;
779 }
780
781 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
782 $testSessionFactory = new ilTestSessionFactory($testOBJ);
783 $testSession = $testSessionFactory->getSessionByUserId($userId);
784
785 if (!$testSession->getActiveId()) {
786 return false;
787 }
788
789 return $testOBJ->canShowCertificate($testSession, $testSession->getUserId(), $testSession->getActiveId());
790 }
791}
$result
static _getMatchingMarkFromObjId($a_obj_id, $percentage)
Returns the matching mark for a given percentage.
An exception for terminatinating execution or to throw for unit testing.
const IL_NO_OBJECT_ACCESS
static _updateTestResultCache($active_id, ilAssQuestionProcessLocker $processLocker=null)
@TODO Move this to a proper place.
Class ilObjTestAccess.
static _lookupOnlineTestAccess($a_test_id, $a_user_id)
Checks if a user is allowd to run an online exam.
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
static hasFinished($a_user_id, $a_obj_id)
Returns (request cached) information if a specific user has finished at least one test pass.
static getConditionOperators()
Get possible conditions operators.
static hasVisibleCertificate($testObjId, $userId)
@ideaof Andre Michels amichels@databay.de
static _getParticipantData($active_id)
Retrieves a participant name from active id.
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
static _getParticipantId($active_id)
Get user id for active id.
static _getPassedUsers($a_obj_id)
Returns an array containing the users who passed the test.
static _isOffline($a_obj_id)
returns the objects's OFFline status
static _getCommands()
get commands
static _checkGoto($a_target)
check whether goto script will succeed
static updateTestResultCache($a_user_id, $a_obj_id)
Update test result cache.
static _lookupObjIdForTestId($a_test_id)
Lookup object id for test id.
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 visibleUserResultExists($testObjId, $userId)
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.
_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 _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the test are given
static _getRandomTestsForQuestionPool($qpl_id)
Get all tests using a question pool for random selection.
static _lookupAnonymity($a_obj_id)
Returns the anonymity status of a test with a given object id.
static _lookupName($a_user_id)
lookup user name
Class ilObjectAccess.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
$tests
Definition: bench.php:104
Interface for condition handling.
$row
$ret
Definition: parser.php:6
$query
global $DIC
Definition: saml.php:7
$lng
foreach($_POST as $key=> $value) $res
global $ilDB
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$ilUser
Definition: imgupload.php:18
$data
Definition: bench.php:6