ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestSkillQuestionAssignment Class Reference
+ Collaboration diagram for ilTestSkillQuestionAssignment:

Public Member Functions

 __construct (ilDB $db)
 loadFromDb ()
 saveToDb ()
 deleteFromDb ()
 dbRecordExists ()
 setSkillPoints ($skillPoints)
 getSkillPoints ()
 setQuestionId ($questionId)
 getQuestionId ()
 setSkillBaseId ($skillBaseId)
 getSkillBaseId ()
 setSkillTrefId ($skillTrefId)
 getSkillTrefId ()
 setTestId ($testId)
 getTestId ()
 loadAdditionalSkillData ()
 setSkillTitle ($skillTitle)
 getSkillTitle ()
 setSkillPath ($skillPath)
 getSkillPath ()

Data Fields

const DEFAULT_COMPETENCE_POINTS = 1

Private Attributes

 $db
 $testId
 $questionId
 $skillBaseId
 $skillTrefId
 $skillPoints
 $skillTitle
 $skillPath

Detailed Description

Definition at line 11 of file class.ilTestSkillQuestionAssignment.php.

Constructor & Destructor Documentation

ilTestSkillQuestionAssignment::__construct ( ilDB  $db)

Definition at line 56 of file class.ilTestSkillQuestionAssignment.php.

References $db.

{
$this->db = $db;
}

Member Function Documentation

ilTestSkillQuestionAssignment::dbRecordExists ( )

Definition at line 128 of file class.ilTestSkillQuestionAssignment.php.

References $query, $res, $row, getQuestionId(), getSkillBaseId(), getSkillTrefId(), and getTestId().

Referenced by saveToDb().

{
$query = "
SELECT COUNT(*) cnt
FROM tst_skl_qst_assigns
WHERE test_fi = %s
AND question_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
";
$res = $this->db->queryF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
);
$row = $this->db->fetchAssoc($res);
return $row['cnt'] > 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::deleteFromDb ( )

Definition at line 112 of file class.ilTestSkillQuestionAssignment.php.

References $query, getQuestionId(), getSkillBaseId(), getSkillTrefId(), and getTestId().

{
$query = "
DELETE FROM tst_skl_qst_assigns
WHERE test_fi = %s
AND question_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
";
$this->db->manipulateF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
);
}

+ Here is the call graph for this function:

ilTestSkillQuestionAssignment::getQuestionId ( )
ilTestSkillQuestionAssignment::getSkillPath ( )

Definition at line 271 of file class.ilTestSkillQuestionAssignment.php.

References $skillPath.

{
}
ilTestSkillQuestionAssignment::getSkillPoints ( )
Returns
int

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

References $skillPoints.

Referenced by ilTestSkillQuestionAssignmentList\incrementMaxPointsBySkill(), and saveToDb().

{
}

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::getSkillTitle ( )

Definition at line 261 of file class.ilTestSkillQuestionAssignment.php.

References $skillTitle.

{
}
ilTestSkillQuestionAssignment::getTestId ( )
Returns
int

Definition at line 224 of file class.ilTestSkillQuestionAssignment.php.

References $testId.

Referenced by dbRecordExists(), deleteFromDb(), loadFromDb(), and saveToDb().

{
return $this->testId;
}

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::loadAdditionalSkillData ( )

Definition at line 229 of file class.ilTestSkillQuestionAssignment.php.

References $path, ilSkillTreeNode\_lookupTitle(), getSkillBaseId(), getSkillTrefId(), setSkillPath(), and setSkillTitle().

{
require_once 'Services/Skill/classes/class.ilBasicSkill.php';
require_once 'Services/Skill/classes/class.ilSkillTree.php';
$this->setSkillTitle(
);
$tree = new ilSkillTree();
$path = $tree->getSkillTreePath(
$this->getSkillBaseId(), $this->getSkillTrefId()
);
$nodes = array();
foreach ($path as $node)
{
if( $node['child'] > 1 && $node['skill_id'] != $this->getSkillBaseId() )
{
$nodes[] = $node['title'];
}
}
$this->setSkillPath(implode(' > ', $nodes));
}

+ Here is the call graph for this function:

ilTestSkillQuestionAssignment::loadFromDb ( )

Definition at line 61 of file class.ilTestSkillQuestionAssignment.php.

References $query, $res, $row, getQuestionId(), getSkillBaseId(), getSkillTrefId(), getTestId(), and setSkillPoints().

{
$query = "
SELECT test_fi, question_fi, skill_base_fi, skill_tref_fi, skill_points
FROM tst_skl_qst_assigns
WHERE test_fi = %s
AND question_fi = %s
AND skill_base_fi = %s
AND skill_tref_fi = %s
";
$res = $this->db->queryF(
$query, array('integer', 'integer', 'integer', 'integer'),
array($this->getTestId(), $this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
);
$row = $this->db->fetchAssoc($res);
if( is_array($row) )
{
$this->setSkillPoints($row['skill_points']);
}
}

+ Here is the call graph for this function:

ilTestSkillQuestionAssignment::saveToDb ( )

Definition at line 85 of file class.ilTestSkillQuestionAssignment.php.

References dbRecordExists(), getQuestionId(), getSkillBaseId(), getSkillPoints(), getSkillTrefId(), and getTestId().

{
if( $this->dbRecordExists() )
{
$this->db->update('tst_skl_qst_assigns', array(
'skill_points' => array('integer', $this->getSkillPoints())
),
array(
'test_fi' => array('integer', $this->getTestId()),
'question_fi' => array('integer', $this->getQuestionId()),
'skill_base_fi' => array('integer', $this->getSkillBaseId()),
'skill_tref_fi' => array('integer', $this->getSkillTrefId())
)
);
}
else
{
$this->db->insert('tst_skl_qst_assigns', array(
'test_fi' => array('integer', $this->getTestId()),
'question_fi' => array('integer', $this->getQuestionId()),
'skill_base_fi' => array('integer', $this->getSkillBaseId()),
'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
'skill_points' => array('integer', $this->getSkillPoints())
));
}
}

+ Here is the call graph for this function:

ilTestSkillQuestionAssignment::setQuestionId (   $questionId)
Parameters
int$questionId

Definition at line 168 of file class.ilTestSkillQuestionAssignment.php.

References $questionId.

{
$this->questionId = $questionId;
}
ilTestSkillQuestionAssignment::setSkillBaseId (   $skillBaseId)
Parameters
int$skillBaseId

Definition at line 184 of file class.ilTestSkillQuestionAssignment.php.

References $skillBaseId.

{
$this->skillBaseId = $skillBaseId;
}
ilTestSkillQuestionAssignment::setSkillPath (   $skillPath)

Definition at line 266 of file class.ilTestSkillQuestionAssignment.php.

References $skillPath.

Referenced by loadAdditionalSkillData().

{
$this->skillPath = $skillPath;
}

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::setSkillPoints (   $skillPoints)
Parameters
int$skillPoints

Definition at line 152 of file class.ilTestSkillQuestionAssignment.php.

References $skillPoints.

Referenced by loadFromDb().

{
$this->skillPoints = $skillPoints;
}

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::setSkillTitle (   $skillTitle)

Definition at line 256 of file class.ilTestSkillQuestionAssignment.php.

References $skillTitle.

Referenced by loadAdditionalSkillData().

{
$this->skillTitle = $skillTitle;
}

+ Here is the caller graph for this function:

ilTestSkillQuestionAssignment::setSkillTrefId (   $skillTrefId)
Parameters
int$skillTrefId

Definition at line 200 of file class.ilTestSkillQuestionAssignment.php.

References $skillTrefId.

{
$this->skillTrefId = $skillTrefId;
}
ilTestSkillQuestionAssignment::setTestId (   $testId)
Parameters
int$testId

Definition at line 216 of file class.ilTestSkillQuestionAssignment.php.

References $testId.

{
$this->testId = $testId;
}

Field Documentation

ilTestSkillQuestionAssignment::$db
private

Definition at line 18 of file class.ilTestSkillQuestionAssignment.php.

Referenced by __construct().

ilTestSkillQuestionAssignment::$questionId
private

Definition at line 28 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getQuestionId(), and setQuestionId().

ilTestSkillQuestionAssignment::$skillBaseId
private

Definition at line 33 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getSkillBaseId(), and setSkillBaseId().

ilTestSkillQuestionAssignment::$skillPath
private

Definition at line 53 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getSkillPath(), and setSkillPath().

ilTestSkillQuestionAssignment::$skillPoints
private

Definition at line 43 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getSkillPoints(), and setSkillPoints().

ilTestSkillQuestionAssignment::$skillTitle
private

Definition at line 48 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getSkillTitle(), and setSkillTitle().

ilTestSkillQuestionAssignment::$skillTrefId
private

Definition at line 38 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getSkillTrefId(), and setSkillTrefId().

ilTestSkillQuestionAssignment::$testId
private

Definition at line 23 of file class.ilTestSkillQuestionAssignment.php.

Referenced by getTestId(), and setTestId().

const ilTestSkillQuestionAssignment::DEFAULT_COMPETENCE_POINTS = 1

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