ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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

◆ __construct()

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

Member Function Documentation

◆ buildSkillLevelThresholdList()

ilTestSkillLevelThresholdsGUI::buildSkillLevelThresholdList ( )
private

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

131 {
132 require_once 'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
133 $thresholdList = new ilTestSkillLevelThresholdList($this->db);
134 $thresholdList->setTestId($this->testOBJ->getTestId());
135
136 return $thresholdList;
137 }

Referenced by showSkillThresholdsCmd().

+ Here is the caller graph for this function:

◆ buildSkillQuestionAssignmentList()

ilTestSkillLevelThresholdsGUI::buildSkillQuestionAssignmentList ( )
private

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

122 {
123 require_once 'Modules/Test/classes/class.ilTestSkillQuestionAssignmentList.php';
124 $assignmentList = new ilTestSkillQuestionAssignmentList($this->db);
125 $assignmentList->setTestId($this->testOBJ->getTestId());
126
127 return $assignmentList;
128 }

Referenced by saveSkillThresholdsCmd(), and showSkillThresholdsCmd().

+ Here is the caller graph for this function:

◆ buildTableGUI()

ilTestSkillLevelThresholdsGUI::buildTableGUI ( )
private

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

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

Referenced by showSkillThresholdsCmd().

+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSkillLevelThresholdsGUI::executeCommand ( )

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

52 {
53 $cmd = $this->ctrl->getCmd('show') . 'Cmd';
54
55 $this->$cmd();
56 }
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ saveSkillThresholdsCmd()

ilTestSkillLevelThresholdsGUI::saveSkillThresholdsCmd ( )
private

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

59 {
60 require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
61
62 if( is_array($_POST['threshold']) )
63 {
64 $threshold = $_POST['threshold'];
65 $assignmentList = $this->buildSkillQuestionAssignmentList();
66 $assignmentList->loadFromDb();
67
68 foreach($assignmentList->getUniqueAssignedSkills() as $data)
69 {
70 $skill = $data['skill'];
71 $skillKey = $data['skill_base_id'].':'.$data['skill_tref_id'];
72 $levels = $skill->getLevelData();
73
74 foreach($levels as $level)
75 {
76 if( isset($threshold[$skillKey]) && isset($threshold[$skillKey][$level['id']]) )
77 {
78 $skillLevelThreshold = new ilTestSkillLevelThreshold($this->db);
79
80 $skillLevelThreshold->setTestId($this->testOBJ->getTestId());
81 $skillLevelThreshold->setSkillBaseId($data['skill_base_id']);
82 $skillLevelThreshold->setSkillTrefId($data['skill_tref_id']);
83 $skillLevelThreshold->setSkillLevelId($level['id']);
84
85 $skillLevelThreshold->setThreshold($threshold[$skillKey][$level['id']]);
86
87 $skillLevelThreshold->saveToDb();
88 }
89 }
90 }
91 }
92
93 ilUtil::sendSuccess($this->lng->txt('tst_msg_skl_lvl_thresholds_saved'), true);
94 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_THRESHOLDS);
95 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12

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

+ Here is the call graph for this function:

◆ showSkillThresholdsCmd()

ilTestSkillLevelThresholdsGUI::showSkillThresholdsCmd ( )
private

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

98 {
99 $table = $this->buildTableGUI();
100
101 $skillLevelThresholdList = $this->buildSkillLevelThresholdList();
102 $skillLevelThresholdList->loadFromDb();
103 $table->setSkillLevelThresholdList($skillLevelThresholdList);
104
105 $assignmentList = $this->buildSkillQuestionAssignmentList();
106 $assignmentList->loadFromDb();
107
108 $table->setData($assignmentList->getUniqueAssignedSkills());
109
110 $this->tpl->setContent($this->ctrl->getHTML($table));
111 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilTestSkillLevelThresholdsGUI::$ctrl
private

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

Referenced by __construct().

◆ $db

ilTestSkillLevelThresholdsGUI::$db
private

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

Referenced by __construct().

◆ $lng

ilTestSkillLevelThresholdsGUI::$lng
private

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

Referenced by __construct().

◆ $testOBJ

ilTestSkillLevelThresholdsGUI::$testOBJ
private

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

Referenced by __construct().

◆ $tpl

ilTestSkillLevelThresholdsGUI::$tpl
private

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

Referenced by __construct().

◆ CMD_SAVE_SKILL_THRESHOLDS

const ilTestSkillLevelThresholdsGUI::CMD_SAVE_SKILL_THRESHOLDS = 'saveSkillThresholds'

◆ CMD_SHOW_SKILL_THRESHOLDS

const ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS = 'showSkillThresholds'

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