24 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
25 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
52 public function __construct($a_parent_obj,$a_course_obj,$a_objective_id,$a_mode)
56 $this->objective_id = $a_objective_id;
57 $this->course_obj = $a_course_obj;
60 $this->lng->loadLanguageModule(
'crs');
65 $this->
addColumn($this->lng->txt(
'type'),
'type',
"1px");
66 $this->
addColumn($this->lng->txt(
'title'),
'title',
'99%');
68 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
69 $this->
setRowTemplate(
"tpl.crs_objective_list_questions_row.html",
"Modules/Course");
75 #$this->setDefaultOrderField('title');
78 $this->mode = $a_mode;
82 $this->
addCommandButton(
'updateSelfAssessmentAssignment',$this->lng->txt(
'crs_wiz_next'));
83 $this->
addCommandButton(
'materialAssignment',$this->lng->txt(
'crs_wiz_back'));
87 $this->
addCommandButton(
'updateFinalTestAssignment',$this->lng->txt(
'crs_wiz_next'));
88 $this->
addCommandButton(
'selfAssessmentAssignment',$this->lng->txt(
'crs_wiz_back'));
104 foreach($a_set[
'sub'] as $sub_data)
112 if($sub_data[
'description'])
114 $this->tpl->setVariable(
'QST_DESCRIPTION',$sub_data[
'description']);
116 $this->tpl->setCurrentBlock(
'qst');
117 $this->tpl->setVariable(
'QST_TITLE',$sub_data[
'title']);
118 $this->tpl->setVariable(
'QST_ID',$a_set[
'id'].
'_'.$sub_data[
'id']);
123 if($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data[
'id']))
125 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
130 if($this->objective_qst_obj->isFinalTestQuestion($sub_data[
'id']))
132 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
136 $this->tpl->parseCurrentBlock();
138 if(count($a_set[
'sub']) and !$a_set[
'random'])
140 $this->tpl->setVariable(
'TXT_QUESTIONS',$this->lng->txt(
'objs_qst'));
144 $this->tpl->setVariable(
'VAL_WARN',$this->lng->txt(
'crs_objective_random_warn'));
147 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
150 $this->tpl->setVariable(
'ROW_TYPE_ALT',$this->lng->txt(
'obj_'.$a_set[
'type']));
152 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
153 if(strlen($a_set[
'description']))
155 $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
166 public function parse($a_assignable)
168 global $objDefinition;
171 foreach($a_assignable as $node)
174 $subobjects = array();
181 include_once
'./Modules/Test/classes/class.ilObjTest.php';
184 foreach($qst = $this->
sortQuestions($tmp_tst->getAllQuestions()) as $question_data)
188 $sub[
'title'] = $tmp_question->getTitle();
189 $sub[
'description'] = $tmp_question->getComment();
190 $sub[
'id'] = $question_data[
'question_id'];
192 $subobjects[] = $sub;
195 $tmp_data[
'title'] = $node[
'title'];
196 $tmp_data[
'description'] = $node[
'description'];
197 $tmp_data[
'type'] = $node[
'type'];
198 $tmp_data[
'id'] = $node[
'child'];
199 $tmp_data[
'obj_id'] = $node[
'obj_id'];
200 $tmp_data[
'sub'] = $subobjects;
216 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';