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)
107 if($sub_data[
'description'])
109 $this->tpl->setVariable(
'QST_DESCRIPTION',$sub_data[
'description']);
111 $this->tpl->setCurrentBlock(
'qst');
112 $this->tpl->setVariable(
'QST_TITLE',$sub_data[
'title']);
113 $this->tpl->setVariable(
'QST_ID',$a_set[
'id'].
'_'.$sub_data[
'id']);
118 if($this->objective_qst_obj->isSelfAssessmentQuestion($sub_data[
'id']))
120 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
125 if($this->objective_qst_obj->isFinalTestQuestion($sub_data[
'id']))
127 $this->tpl->setVariable(
'QST_CHECKED',
'checked="checked"');
131 $this->tpl->parseCurrentBlock();
133 if(count($a_set[
'sub']))
135 $this->tpl->setVariable(
'TXT_QUESTIONS',$this->lng->txt(
'objs_qst'));
138 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
141 $this->tpl->setVariable(
'ROW_TYPE_ALT',$this->lng->txt(
'obj_'.$a_set[
'type']));
143 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
144 if(strlen($a_set[
'description']))
146 $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
157 public function parse($a_assignable)
159 global $objDefinition;
162 foreach($a_assignable as $node)
165 $subobjects = array();
172 foreach($qst = $this->
sortQuestions($tmp_tst->getAllQuestions()) as $question_data)
176 $sub[
'title'] = $tmp_question->getTitle();
177 $sub[
'description'] = $tmp_question->getComment();
178 $sub[
'id'] = $question_data[
'question_id'];
180 $subobjects[] = $sub;
183 $tmp_data[
'title'] = $node[
'title'];
184 $tmp_data[
'description'] = $node[
'description'];
185 $tmp_data[
'type'] = $node[
'type'];
186 $tmp_data[
'id'] = $node[
'child'];
187 $tmp_data[
'obj_id'] = $node[
'obj_id'];
188 $tmp_data[
'sub'] = $subobjects;
204 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';