ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLOUtils Class Reference

Settings for LO courses. More...

+ Collaboration diagram for ilLOUtils:

Static Public Member Functions

static isCompleted ($a_cont_oid, $a_test_rid, $a_objective_id, $max_points, $reached, $limit_perc)
 Check if objective is completed.
static lookupObjectiveRequiredPercentage ($a_container_id, $a_objective_id, $a_test_type, $a_max_points)
static lookupMaxAttempts ($a_container_id, $a_objective_id)
static lookupRandomTest ($a_test_obj_id)
 Check if test is a random test.
static lookupQplBySequence ($a_test_ref_id, $a_sequence_id)
 Lookup assigned qpl name (including taxonomy) by sequence.
static hasActiveRun ($a_container_id, $a_test_ref_id, $a_objective_id)

Static Protected Member Functions

static buildQplTitleByDefinition (ilTestRandomQuestionSetSourcePoolDefinition $def, ilTestTaxonomyFilterLabelTranslater $trans)
 build title by definition

Detailed Description

Settings for LO courses.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 10 of file class.ilLOUtils.php.

Member Function Documentation

static ilLOUtils::buildQplTitleByDefinition ( ilTestRandomQuestionSetSourcePoolDefinition  $def,
ilTestTaxonomyFilterLabelTranslater  $trans 
)
staticprotected

build title by definition

Parameters
ilTestRandomQuestionSetSourcePoolDefinition$def

Definition at line 160 of file class.ilLOUtils.php.

References ilTestRandomQuestionSetSourcePoolDefinition\getMappedFilterTaxId(), ilTestRandomQuestionSetSourcePoolDefinition\getMappedFilterTaxNodeId(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolTitle(), and ilTestTaxonomyFilterLabelTranslater\getTaxonomyTreeLabel().

Referenced by lookupQplBySequence().

{
$title = $def->getPoolTitle();
$tax_id = $def->getMappedFilterTaxId();
if($tax_id)
{
$title .= (' -> '. $trans->getTaxonomyTreeLabel($tax_id));
}
$tax_node = $def->getMappedFilterTaxNodeId();
if($tax_node)
{
$title .= (' -> ' .$trans->getTaxonomyNodeLabel($tax_node));
}
return $title;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::hasActiveRun (   $a_container_id,
  $a_test_ref_id,
  $a_objective_id 
)
static

Definition at line 176 of file class.ilLOUtils.php.

References $GLOBALS, ilObject\_lookupObjId(), ilObjTest\isParticipantsLastPassActive(), and ilLOTestRun\lookupObjectives().

Referenced by ilContainerObjectiveGUI\showObjectives().

{
// check if pass exists
include_once './Modules/Test/classes/class.ilObjTest.php';
if(
$a_test_ref_id,
$GLOBALS['ilUser']->getId())
)
{
return false;
}
// check if multiple pass exists
include_once './Modules/Course/classes/Objectives/class.ilLOTestRun.php';
$last_objectives = ilLOTestRun::lookupObjectives(
$a_container_id,
$GLOBALS['ilUser']->getId(),
ilObject::_lookupObjId($a_test_ref_id)
);
if(count((array) $last_objectives) and in_array((int) $a_objective_id, (array) $last_objectives))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::isCompleted (   $a_cont_oid,
  $a_test_rid,
  $a_objective_id,
  $max_points,
  $reached,
  $limit_perc 
)
static

Check if objective is completed.

Definition at line 16 of file class.ilLOUtils.php.

References ilObject\_lookupObjId(), and ilLOSettings\getInstanceByObjId().

Referenced by ilLOTestQuestionAdapter\updateQuestionResult().

{
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$settings = ilLOSettings::getInstanceByObjId($a_cont_oid);
if(self::lookupRandomTest(ilObject::_lookupObjId($a_test_rid)))
{
if(!$max_points)
{
return true;
}
else
{
return ($reached / $max_points * 100) >= $limit_perc;
}
}
else
{
if(!$max_points)
{
return TRUE;
}
else
{
return ($reached / $max_points * 100) >= $limit_perc;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::lookupMaxAttempts (   $a_container_id,
  $a_objective_id 
)
static
Parameters
type$a_container_id
type$a_objective_id
type$a_passes
Returns
boolean

Definition at line 84 of file class.ilLOUtils.php.

References ilLOSettings\getInstanceByObjId(), and ilCourseObjective\lookupMaxPasses().

Referenced by ilLOTestQuestionAdapter\initUserResult().

{
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$settings = ilLOSettings::getInstanceByObjId($a_container_id);
if($settings->isGeneralQualifiedTestVisible())
{
return 0;
}
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$max_passes = ilCourseObjective::lookupMaxPasses($a_objective_id);
return (int) $max_passes;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::lookupObjectiveRequiredPercentage (   $a_container_id,
  $a_objective_id,
  $a_test_type,
  $a_max_points 
)
static
Parameters
type$a_container_id
type$a_objective_id
type$a_test_type

Definition at line 51 of file class.ilLOUtils.php.

References ilObject\_lookupObjId(), ilLOSettings\getInstanceByObjId(), ilLORandomTestQuestionPools\lookupLimit(), ilCourseObjectiveQuestion\loookupTestLimit(), and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by ilLOTestQuestionAdapter\initUserResult().

{
include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
$settings = ilLOSettings::getInstanceByObjId($a_container_id);
{
$tst_ref_id = $settings->getQualifiedTest();
}
else
{
$tst_ref_id = $settings->getInitialTest();
}
if(self::lookupRandomTest(ilObject::_lookupObjId($tst_ref_id)))
{
include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
return (int) ilLORandomTestQuestionPools::lookupLimit($a_container_id, $a_objective_id, $a_test_type);
}
else
{
include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
return $limit;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::lookupQplBySequence (   $a_test_ref_id,
  $a_sequence_id 
)
static

Lookup assigned qpl name (including taxonomy) by sequence.

Parameters
type$a_test_ref_id
type$a_sequence_id
Returns
string

Definition at line 116 of file class.ilLOUtils.php.

References $GLOBALS, buildQplTitleByDefinition(), and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseObjectivesTableGUI\parse().

{
if(!$a_sequence_id)
{
return '';
}
$tst = ilObjectFactory::getInstanceByRefId($a_test_ref_id,false);
if(!$tst instanceof ilObjTest)
{
return '';
}
include_once './Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
include_once './Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
$GLOBALS['ilDB'],
$tst,
$GLOBALS['ilDB'],
$tst
)
);
$list->loadDefinitions();
include_once './Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
$translator = new ilTestTaxonomyFilterLabelTranslater($GLOBALS['ilDB']);
$translator->loadLabels($list);
$title = '';
foreach ($list as $definition)
{
if($definition->getId() != $a_sequence_id)
{
continue;
}
$title = self::buildQplTitleByDefinition($definition, $translator);
}
return $title;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLOUtils::lookupRandomTest (   $a_test_obj_id)
static

Check if test is a random test.

Parameters
type$a_test_obj_id
Returns
bool

Definition at line 104 of file class.ilLOUtils.php.

References ilObjTest\_lookupRandomTest().

Referenced by ilLOEditorStatus\lookupQuestionsAssigned(), and ilCourseObjectivesTableGUI\parse().

{
include_once './Modules/Test/classes/class.ilObjTest.php';
return ilObjTest::_lookupRandomTest($a_test_obj_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: