24 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
25 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
27 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
58 public function __construct($a_parent_obj,$a_course_obj,$a_objective_id,$a_mode)
62 $this->objective_id = $a_objective_id;
63 $this->course_obj = $a_course_obj;
70 $this->lng->loadLanguageModule(
'crs');
75 $this->
addColumn($this->lng->txt(
'type'),
'type',
"20px");
76 $this->
addColumn($this->lng->txt(
'title'),
'title',
'');
78 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
79 $this->
setRowTemplate(
"tpl.crs_objective_list_questions_row.html",
"Modules/Course");
85 #$this->setDefaultOrderField('title');
88 $this->mode = $a_mode;
92 $this->
addCommandButton(
'updateSelfAssessmentAssignment',$this->lng->txt(
'crs_wiz_next'));
93 $this->
addCommandButton(
'materialAssignment',$this->lng->txt(
'crs_wiz_back'));
97 $this->
addCommandButton(
'updateFinalTestAssignment',$this->lng->txt(
'crs_wiz_next'));
98 $this->
addCommandButton(
'selfAssessmentAssignment',$this->lng->txt(
'crs_wiz_back'));
125 foreach($a_set[
'sub'] as $sub_data)
133 if($sub_data[
'description'])
135 $this->tpl->setVariable(
'QST_DESCRIPTION',$sub_data[
'description']);
137 if($sub_data[
'qst_txt'])
139 $txt = $sub_data[
'qst_txt'];
140 if($sub_data[
'qst_points'])
142 $this->lng->loadLanguageModule(
'assessment');
143 $txt .= (
' ('.$sub_data[
'qst_points'].
' '.$this->lng->txt(
'points').
')');
146 $this->tpl->setVariable(
'QST_DESCRIPTION',
$txt);
148 $this->tpl->setCurrentBlock(
'qst');
149 $this->tpl->setVariable(
'QST_TITLE',$sub_data[
'title']);
150 $this->tpl->setVariable(
'QST_ID',$a_set[
'id'].
'_'.$sub_data[
'id']);
155 if($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data[
'id']))
157 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
162 if($this->objective_qst_obj->isFinalTestQuestion($sub_data[
'id']))
164 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
168 $this->tpl->parseCurrentBlock();
170 if(count($a_set[
'sub']) and !$a_set[
'random'])
172 $this->tpl->setVariable(
'TXT_QUESTIONS',$this->lng->txt(
'objs_qst'));
176 $this->tpl->setVariable(
'VAL_WARN',$this->lng->txt(
'crs_objective_random_warn'));
179 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
181 $this->tpl->setVariable(
'ROW_TYPE_IMG',
ilObject::_getIcon($a_set[
'obj_id'],
"tiny", $a_set[
'type']));
182 $this->tpl->setVariable(
'ROW_TYPE_ALT',$this->lng->txt(
'obj_'.$a_set[
'type']));
184 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
185 if(strlen($a_set[
'description']))
187 $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
198 public function parse($a_assignable)
200 global $objDefinition;
207 foreach($a_assignable as $node)
210 $subobjects = array();
217 include_once
'./Modules/Test/classes/class.ilObjTest.php';
219 $tmp_data[
'random'] =
false;
221 foreach($qst = $this->
sortQuestions($tmp_tst->getAllQuestions()) as $question_data)
224 #$sub['qst_txt'] = $tmp_question->_getQuestionText($question_data['question_id']);
225 $sub[
'qst_txt'] =
'';
226 $sub[
'qst_points'] = $tmp_question->_getMaximumPoints($question_data[
'question_id']);
228 $sub[
'title'] = $tmp_question->getTitle();
229 $sub[
'description'] = $tmp_question->getComment();
230 $sub[
'id'] = $question_data[
'question_id'];
232 $subobjects[] = $sub;
235 $tmp_data[
'title'] = $node[
'title'];
236 $tmp_data[
'description'] = $node[
'description'];
237 $tmp_data[
'type'] = $node[
'type'];
238 $tmp_data[
'id'] = $node[
'child'];
239 $tmp_data[
'obj_id'] = $node[
'obj_id'];
240 $tmp_data[
'sub'] = $subobjects;
252 $tst_ref_id = $this->
getSettings()->getInitialTest();
255 return array(
$GLOBALS[
'tree']->getNodeData($tst_ref_id));
260 $tst_ref_id = $this->
getSettings()->getQualifiedTest();
263 return array(
$GLOBALS[
'tree']->getNodeData($tst_ref_id));
278 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';