5 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
6 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
7 include_once
'./Modules/Course/exceptions/class.ilLOInvalidConfiguationException.php';
34 public function __construct($a_parent_obj, $a_parent_cmd, $a_container_id, $a_test_type, $a_assignment_type = self::TYPE_SINGLE_ASSIGNMENTS)
36 $this->test_type = $a_test_type;
37 $this->assignment_type = $a_assignment_type;
38 $this->container_id = $a_container_id;
40 $this->
setId(
'obj_loc_' . $a_container_id);
41 parent::__construct($a_parent_obj, $a_parent_cmd);
50 switch ($this->test_type) {
53 if ($this->
getSettings()->isInitialTestQualifying()) {
54 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_its_q_all'));
56 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_its_nq_all'));
59 if ($this->
getSettings()->isInitialTestQualifying()) {
60 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_it_q'));
62 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_it_nq'));
70 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_qts_all'));
72 $this->
setTitle($this->lng->txt(
'crs_loc_settings_tbl_qt'));
98 $this->
addColumn($this->lng->txt(
'title'),
'title');
101 $this->
addColumn($this->lng->txt(
'crs_objectives'),
'objective');
104 $this->
addColumn($this->lng->txt(
'crs_loc_tbl_tst_type'),
'ttype');
105 $this->
addColumn($this->lng->txt(
'crs_loc_tbl_tst_qst_qpl'),
'qstqpl');
108 $this->
setRowTemplate(
"tpl.crs_loc_tst_row.html",
"Modules/Course");
112 $this->
addMultiCommand(
'confirmDeleteTests', $this->lng->txt(
'crs_loc_delete_assignment'));
116 $this->
addMultiCommand(
'confirmDeleteTest', $this->lng->txt(
'crs_loc_delete_assignment'));
133 $this->tpl->setVariable(
'VAL_ID', $set[
'assignment_id']);
135 $this->tpl->setVariable(
'VAL_ID', $set[
'ref_id']);
137 $this->tpl->setVariable(
'VAL_TITLE', $set[
'title']);
138 include_once
'./Services/Link/classes/class.ilLink.php';
140 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'ref_id', $set[
'ref_id']);
141 $ilCtrl->setParameterByClass(
'ilobjtestgui',
'cmd',
'questionsTabGateway');
142 $this->tpl->setVariable(
144 $ilCtrl->getLinkTargetByClass(
'ilobjtestgui')
148 $this->tpl->setCurrentBlock(
'objectives');
149 $this->tpl->setVariable(
'VAL_OBJECTIVE', (
string) $set[
'objective']);
150 $this->tpl->parseCurrentBlock();
155 #$this->tpl->setVariable('TITLE_LINK',ilLink::_getLink($set['ref_id'])); 156 if (strlen($set[
'description'])) {
157 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
160 switch ($set[
'ttype']) {
162 $type = $this->lng->txt(
'tst_question_set_type_fixed');
166 $type = $this->lng->txt(
'tst_question_set_type_random');
170 $this->tpl->setVariable(
'VAL_TTYPE',
$type);
171 $this->tpl->setVariable(
'VAL_QST_QPL', $set[
'qst_info']);
173 if (isset($set[
'qpls']) && is_array($set[
'qpls']) && count($set[
'qpls']) > 0) {
174 foreach ($set[
'qpls'] as
$title) {
175 $this->tpl->setCurrentBlock(
'qpl');
176 $this->tpl->setVariable(
'MAT_TITLE', $title);
177 $this->tpl->parseCurrentBlock();
179 $this->tpl->touchBlock(
'ul_begin');
180 $this->tpl->touchBlock(
'ul_end');
186 include_once
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
189 $available = $assignments->getAssignmentsByType($this->test_type);
191 foreach ($available as $assignment) {
193 $tmp = $this->doParse($assignment->getTestRefId(), $assignment->getObjectiveId());
195 $assignment->delete();
200 $tmp[
'assignment_id'] = $assignment->getAssignmentId();
213 public function parse($a_tst_ref_id)
215 $this->
setData(array($this->doParse($a_tst_ref_id)));
223 protected function doParse($a_tst_ref_id, $a_objective_id = 0)
225 include_once
'./Modules/Test/classes/class.ilObjTest.php';
231 $tst_data[
'ref_id'] = $tst->getRefId();
232 $tst_data[
'title'] = $tst->getTitle();
233 $tst_data[
'description'] = $tst->getLongDescription();
234 $tst_data[
'ttype'] = $tst->getQuestionSetType();
238 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
242 switch ($tst->getQuestionSetType()) {
244 $tst_data[
'qst_info'] = $this->lng->txt(
'crs_loc_tst_num_qst');
245 $tst_data[
'qst_info'] .= (
' ' . count($tst->getAllQuestions()));
250 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
251 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
262 $list->loadDefinitions();
265 include_once
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
267 $translater->loadLabels(
$list);
269 $tst_data[
'qst_info'] = $this->lng->txt(
'crs_loc_tst_qpls');
271 foreach (
$list as $definition) {
273 $title = $definition->getPoolTitle();
275 $filterTitle = array();
276 $filterTitle[] = $translater->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
277 $filterTitle[] = $translater->getTypeFilterLabel($definition->getTypeFilter());
278 if (!empty($filterTitle)) {
279 $title .=
' -> ' . implode(
' / ', $filterTitle);
281 #$tax_id = $definition->getMappedFilterTaxId(); 284 # $title .= (' -> '. $translater->getTaxonomyTreeLabel($tax_id)); 286 #$tax_node = $definition->getMappedFilterTaxNodeId(); 289 # $title .= (' -> ' .$translater->getTaxonomyNodeLabel($tax_node)); 292 $tst_data[
'qpls'][] =
$title;
296 $tst_data[
'qst_info'] .= (
' ' . (int) 0);
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
if(isset($_REQUEST['delete'])) $list
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const TYPE_MULTIPLE_ASSIGNMENTS
getParentObject()
Get parent object.
getSettings()
Get settings.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct($a_parent_obj, $a_parent_cmd, $a_container_id, $a_test_type, $a_assignment_type=self::TYPE_SINGLE_ASSIGNMENTS)
Constructor.
parseMultipleAssignments()
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
Class ilLOTestAssignmentTableGUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
Class ilLOInvalidConfigurationException.
getFormAction()
Get Form action parameter.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
const TYPE_SINGLE_ASSIGNMENTS
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
const TYPE_TEST_QUALIFIED
parse($a_tst_ref_id)
Parse single test assignment.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.