16 public static function isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached, $limit_perc)
18 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
29 return ($reached / $max_points * 100) >= $limit_perc;
34 $required_perc = self::lookupObjectiveRequiredPercentage($a_cont_oid, $a_objective_id, $a_test_rid, $max_points);
42 return ($reached / $max_points * 100) >= $required_perc;
55 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
58 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
60 $a_test_type = $assignments->getTypeByTest($a_test_ref_id);
62 if($assignments->isSeparateTest($a_test_ref_id))
64 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
66 $tst = $factory->getInstanceByRefId($a_test_ref_id, FALSE);
69 $schema = $tst->getMarkSchema();
70 foreach(
$schema->getMarkSteps() as $mark)
72 if($mark->getPassed())
74 return (
int) $mark->getMinimumLevel();
82 $tst_ref_id = $a_test_ref_id;
85 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
90 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
103 public static function lookupMaxAttempts($a_container_id, $a_objective_id, $a_test_ref_id)
107 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
112 if(!$assignments->isSeparateTest($a_test_ref_id))
118 $query =
'SELECT nr_of_tries FROM tst_tests '.
123 return (
int)
$row->nr_of_tries;
136 include_once
'./Modules/Test/classes/class.ilObjTest.php';
157 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
158 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
168 $list->loadDefinitions();
170 include_once
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
172 $translator->loadLabels($list);
175 foreach ($list as $definition)
177 if($definition->getId() != $a_sequence_id)
181 $title = self::buildQplTitleByDefinition($definition, $translator);
201 $title .= (
' -> ' .$trans->getTaxonomyNodeLabel($tax_node));
206 public static function hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
211 include_once
'./Modules/Test/classes/class.ilObjTest.php';
222 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
229 if(count((
array) $last_objectives)
and in_array((
int) $a_objective_id, (
array) $last_objectives))
240 if($ilUser->getId() == ANONYMOUS_USER_ID)
246 if($a_user_id == $ilUser->getId())
248 $valid = $ilAccess->checkAccess(
'read',
'', $a_test_ref_id);
252 $valid = $ilAccess->checkAccess(
'write',
'', $a_test_ref_id);
260 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
263 $ilCtrl->setParameterByClass(
'ilObjTestGUI',
'ref_id', $a_test_ref_id);
264 $link = $ilCtrl->getLinkTargetByClass(
array(
'ilRepositoryGUI',
'ilObjTestGUI'),
'userResultsGateway');
265 $ilCtrl->setParameterByClass(
'ilObjTestGUI',
'ref_id',
'');
271 include_once
'Modules/Test/classes/class.ilObjTest.php';
278 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'ref_id', $a_test_ref_id);
279 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'active_id', $userActiveId);
280 $link = $ilCtrl->getLinkTargetByClass(
array(
'ilRepositoryGUI',
'ilObjTestGUI',
'ilTestEvaluationGUI'),
'outParticipantsResultsOverview');
281 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'ref_id',
'');
282 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'active_id',
'');
static isCompleted($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached, $limit_perc)
Check if objective is completed.
static getInstanceByObjId($a_obj_id)
get singleton instance
static loookupTestLimit($a_test_id, $a_objective_id)
static getInstance($a_container_id)
Get instance by container id.
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
getMappedFilterTaxNodeId()
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
static lookupObjectives($a_container_id, $a_user_id, $a_test_id)
static visibleUserResultExists($testObjId, $userId)
static lookupRandomTest($a_test_obj_id)
Check if test is a random test.
static _lookupObjId($a_id)
static lookupObjectiveRequiredPercentage($a_container_id, $a_objective_id, $a_test_ref_id, $a_max_points)
static _getTestIDFromObjectID($object_id)
Returns the ILIAS test id for a given object id.
Create styles array
The data for the language used.
static getTestResultLinkForUser($a_test_ref_id, $a_user_id)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static lookupLimit($a_container_id, $a_objective_id, $a_test_type)
static isParticipantsLastPassActive($testRefId, $userId)
getTaxonomyTreeLabel($taxonomyTreeId)
static lookupQplBySequence($a_test_ref_id, $a_sequence_id)
Lookup assigned qpl name (including taxonomy) by sequence.
static _getActiveIdOfUser($user_id="", $test_id="")
Gets the active id of the tst_active table for the active user.
static buildQplTitleByDefinition(ilTestRandomQuestionSetSourcePoolDefinition $def, ilTestTaxonomyFilterLabelTranslater $trans)
build title by definition