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';
25 return ($reached / $max_points * 100) >= $limit_perc;
28 $required_perc = self::lookupObjectiveRequiredPercentage($a_cont_oid, $a_objective_id, $a_test_rid, $max_points);
33 return ($reached / $max_points * 100) >= $required_perc;
46 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
49 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
51 $a_test_type = $assignments->getTypeByTest($a_test_ref_id);
53 if ($assignments->isSeparateTest($a_test_ref_id)) {
54 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
56 $tst =
$factory->getInstanceByRefId($a_test_ref_id,
false);
58 $schema = $tst->getMarkSchema();
59 foreach (
$schema->getMarkSteps() as $mark) {
60 if ($mark->getPassed()) {
61 return (
int) $mark->getMinimumLevel();
69 $tst_ref_id = $a_test_ref_id;
71 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
74 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
87 public static function lookupMaxAttempts($a_container_id, $a_objective_id, $a_test_ref_id)
91 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
96 if (!$assignments->isSeparateTest($a_test_ref_id)) {
101 $query =
'SELECT nr_of_tries FROM tst_tests ' .
105 return (
int)
$row->nr_of_tries;
118 include_once
'./Modules/Test/classes/class.ilObjTest.php';
130 if (!$a_sequence_id) {
137 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
138 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
148 $list->loadDefinitions();
150 include_once
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
155 foreach (
$list as $definition) {
156 if ($definition->getId() != $a_sequence_id) {
172 $filterTitle =
array();
175 if (!empty($filterTitle)) {
176 $title .=
' -> ' . implode(
' / ', $filterTitle);
178 #$tax_id = $def->getMappedFilterTaxId(); 181 # $title .= (' -> '. $trans->getTaxonomyTreeLabel($tax_id)); 183 #$tax_node = $def->getMappedFilterTaxNodeId(); 186 # $title .= (' -> ' .$trans->getTaxonomyNodeLabel($tax_node)); 192 public static function hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
197 include_once
'./Modules/Test/classes/class.ilObjTest.php';
208 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestRun.php';
215 if (count((
array) $last_objectives) and in_array((
int) $a_objective_id, (
array) $last_objectives)) {
225 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
230 if ($a_user_id == $ilUser->getId()) {
231 $valid = $ilAccess->checkAccess(
'read',
'', $a_test_ref_id);
234 $valid = $ilAccess->checkAccess(
'write',
'', $a_test_ref_id);
240 require_once
'Modules/Test/classes/class.ilObjTestAccess.php';
242 $ilCtrl->setParameterByClass(
'ilObjTestGUI',
'ref_id', $a_test_ref_id);
243 $link = $ilCtrl->getLinkTargetByClass(
array(
'ilRepositoryGUI',
'ilObjTestGUI'),
'userResultsGateway');
244 $ilCtrl->setParameterByClass(
'ilObjTestGUI',
'ref_id',
'');
248 include_once
'Modules/Test/classes/class.ilObjTest.php';
253 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'ref_id', $a_test_ref_id);
254 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'active_id', $userActiveId);
255 $link = $ilCtrl->getLinkTargetByClass(
array(
'ilRepositoryGUI',
'ilObjTestGUI',
'ilTestEvaluationGUI'),
'outParticipantsResultsOverview');
256 $ilCtrl->setParameterByClass(
'ilTestEvaluationGUI',
'ref_id',
'');
257 $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.
if(isset($_REQUEST['delete'])) $list
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getTaxonomyFilterLabel($filter=array(), $filterDelimiter='+', $taxNodeDelimiter=':', $nodesDelimiter=', ')
Get the label for a taxonomy filter.
static hasActiveRun($a_container_id, $a_test_ref_id, $a_objective_id)
static lookupObjectives($a_container_id, $a_user_id, $a_test_id)
foreach($_POST as $key=> $value) $res
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.
getTypeFilterLabel($filter=array())
Get the label for a type filter.
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)
lookup limit type $ilDB
static isParticipantsLastPassActive($testRefId, $userId)
static lookupQplBySequence($a_test_ref_id, $a_sequence_id)
Lookup assigned qpl name (including taxonomy) by sequence.
getMappedTaxonomyFilter()
get the mapped taxonomy filter conditions
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