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

Public Member Functions

 __construct (ilCtrl $ctrl, ilTemplate $tpl, ilLanguage $lng, ilDB $db, ilObjTest $testOBJ)
 executeCommand ()

Data Fields

const CMD_SHOW_SKILL_THRESHOLDS = 'showSkillThresholds'
const CMD_SAVE_SKILL_THRESHOLDS = 'saveSkillThresholds'

Private Member Functions

 saveSkillThresholdsCmd ()
 showSkillThresholdsCmd ()
 buildTableGUI ()
 buildSkillQuestionAssignmentList ()
 buildSkillLevelThresholdList ()

Private Attributes

 $ctrl
 $tpl
 $lng
 $db
 $testOBJ

Detailed Description

Definition at line 13 of file class.ilTestSkillLevelThresholdsGUI.php.

Constructor & Destructor Documentation

ilTestSkillLevelThresholdsGUI::__construct ( ilCtrl  $ctrl,
ilTemplate  $tpl,
ilLanguage  $lng,
ilDB  $db,
ilObjTest  $testOBJ 
)

Definition at line 42 of file class.ilTestSkillLevelThresholdsGUI.php.

References $ctrl, $db, $lng, $testOBJ, and $tpl.

{
$this->ctrl = $ctrl;
$this->tpl = $tpl;
$this->lng = $lng;
$this->db = $db;
$this->testOBJ = $testOBJ;
}

Member Function Documentation

ilTestSkillLevelThresholdsGUI::buildSkillLevelThresholdList ( )
private

Definition at line 130 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by showSkillThresholdsCmd().

{
require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
$thresholdList = new ilTestSkillLevelThresholdList($this->db);
$thresholdList->setTestId($this->testOBJ->getTestId());
return $thresholdList;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdsGUI::buildSkillQuestionAssignmentList ( )
private

Definition at line 121 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by saveSkillThresholdsCmd(), and showSkillThresholdsCmd().

{
require_once 'Modules/Test/classes/class.ilTestSkillQuestionAssignmentList.php';
$assignmentList = new ilTestSkillQuestionAssignmentList($this->db);
$assignmentList->setTestId($this->testOBJ->getTestId());
return $assignmentList;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdsGUI::buildTableGUI ( )
private

Definition at line 113 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by showSkillThresholdsCmd().

{
require_once 'Modules/Test/classes/tables/class.ilTestSkillLevelThresholdsTableGUI.php';
$table = new ilTestSkillLevelThresholdsTableGUI($this, self::CMD_SHOW_SKILL_THRESHOLDS, $this->ctrl, $this->lng);
return $table;
}

+ Here is the caller graph for this function:

ilTestSkillLevelThresholdsGUI::executeCommand ( )

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

References $cmd.

{
$cmd = $this->ctrl->getCmd('show') . 'Cmd';
$this->$cmd();
}
ilTestSkillLevelThresholdsGUI::saveSkillThresholdsCmd ( )
private

Definition at line 58 of file class.ilTestSkillLevelThresholdsGUI.php.

References $_POST, buildSkillQuestionAssignmentList(), and ilUtil\sendSuccess().

{
require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
if( is_array($_POST['threshold']) )
{
$threshold = $_POST['threshold'];
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
foreach($assignmentList->getUniqueAssignedSkills() as $data)
{
$skill = $data['skill'];
$skillKey = $data['skill_base_id'].':'.$data['skill_tref_id'];
$levels = $skill->getLevelData();
foreach($levels as $level)
{
if( isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']]) )
{
$skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
$skillLevelThreshold->setTestId($this->testOBJ->getTestId());
$skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
$skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
$skillLevelThreshold->setSkillLevelId($level['id']);
$skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
$skillLevelThreshold->saveToDb();
}
}
}
}
ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
}

+ Here is the call graph for this function:

ilTestSkillLevelThresholdsGUI::showSkillThresholdsCmd ( )
private

Definition at line 97 of file class.ilTestSkillLevelThresholdsGUI.php.

References buildSkillLevelThresholdList(), buildSkillQuestionAssignmentList(), and buildTableGUI().

{
$table = $this->buildTableGUI();
$skillLevelThresholdList = $this->buildSkillLevelThresholdList();
$skillLevelThresholdList->loadFromDb();
$table->setSkillLevelThresholdList($skillLevelThresholdList);
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
$table->setData($assignmentList->getUniqueAssignedSkills());
$this->tpl->setContent($this->ctrl->getHTML($table));
}

+ Here is the call graph for this function:

Field Documentation

ilTestSkillLevelThresholdsGUI::$ctrl
private

Definition at line 20 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by __construct().

ilTestSkillLevelThresholdsGUI::$db
private

Definition at line 35 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by __construct().

ilTestSkillLevelThresholdsGUI::$lng
private

Definition at line 30 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by __construct().

ilTestSkillLevelThresholdsGUI::$testOBJ
private

Definition at line 40 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by __construct().

ilTestSkillLevelThresholdsGUI::$tpl
private

Definition at line 25 of file class.ilTestSkillLevelThresholdsGUI.php.

Referenced by __construct().

const ilTestSkillLevelThresholdsGUI::CMD_SAVE_SKILL_THRESHOLDS = 'saveSkillThresholds'
const ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS = 'showSkillThresholds'

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