24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
51 $this->course_obj = $a_course_obj;
54 $this->lng->loadLanguageModule(
'crs');
57 parent::__construct($a_parent_obj,
'questionOverview');
59 $this->
addColumn($this->lng->txt(
'title'),
'title',
'33%');
60 $this->
addColumn($this->lng->txt(
'crs_objective_self_assessment'),
'self',
'33%%');
61 $this->
addColumn($this->lng->txt(
'crs_objective_final_test'),
'final',
'33%');
63 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
64 $this->
setRowTemplate(
"tpl.crs_questions_table_row.html",
"Modules/Course");
68 $this->
enable(
'select_all');
83 static $row_counter = 1;
85 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
86 if (strlen($a_set[
'description'])) {
87 $this->tpl->setVariable(
'VAL_DESC', $a_set[
'description']);
90 foreach ($a_set[
'self_tests'] as $tst) {
91 foreach ($tst[
'questions'] as $qst) {
92 $this->tpl->setCurrentBlock(
'self_qst');
93 $this->tpl->setVariable(
'SELF_QST_TITLE', $qst[
'title']);
94 if (strlen($qst[
'description'])) {
95 $this->tpl->setVariable(
'SELF_QST_DESCRIPTION', $qst[
'description']);
97 $this->tpl->setVariable(
'SELF_QST_POINTS', $qst[
'points']);
98 $this->tpl->setVariable(
'SELF_QST_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
99 $this->tpl->parseCurrentBlock();
101 $this->tpl->setCurrentBlock(
'self_tst');
102 $this->tpl->setVariable(
'SELF_TST_TITLE', $tst[
'title']);
103 if (strlen($tst[
'description'])) {
104 $this->tpl->setVariable(
'SELF_TST_DESC', $tst[
'description']);
107 $this->tpl->setVariable(
'SELF_TYPE_ALT', $this->lng->txt(
'obj_tst'));
108 $this->tpl->parseCurrentBlock();
110 if (count($a_set[
'self_tests'])) {
111 $this->tpl->setVariable(
'SELF_TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
112 $this->tpl->setVariable(
'SELF_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
113 $this->tpl->setVariable(
'SELF_TXT_REQ_POINTS', $this->lng->txt(
'crs_obj_required_points'));
114 $this->tpl->setVariable(
'SELF_POINTS', $a_set[
'self_max_points']);
115 $this->tpl->setVariable(
'SELF_ID', $a_set[
'id']);
116 $this->tpl->setVariable(
'SELF_LIMIT', $a_set[
'self_limit']);
119 foreach ($a_set[
'final_tests'] as $tst) {
120 foreach ($tst[
'questions'] as $qst) {
121 $this->tpl->setCurrentBlock(
'final_qst');
122 $this->tpl->setVariable(
'FINAL_QST_TITLE', $qst[
'title']);
123 if (strlen($qst[
'description'])) {
124 $this->tpl->setVariable(
'FINAL_QST_DESCRIPTION', $qst[
'description']);
126 $this->tpl->setVariable(
'FINAL_QST_POINTS', $qst[
'points']);
127 $this->tpl->setVariable(
'FINAL_QST_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
128 $this->tpl->parseCurrentBlock();
130 $this->tpl->setCurrentBlock(
'final_tst');
131 $this->tpl->setVariable(
'FINAL_TST_TITLE', $tst[
'title']);
132 if (strlen($tst[
'description'])) {
133 $this->tpl->setVariable(
'FINAL_TST_DESC', $tst[
'description']);
136 $this->tpl->setVariable(
'FINAL_TYPE_ALT', $this->lng->txt(
'obj_tst'));
137 $this->tpl->parseCurrentBlock();
139 if (count($a_set[
'final_tests'])) {
140 $this->tpl->setVariable(
'FINAL_TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
141 $this->tpl->setVariable(
'FINAL_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
142 $this->tpl->setVariable(
'FINAL_TXT_REQ_POINTS', $this->lng->txt(
'crs_obj_required_points'));
143 $this->tpl->setVariable(
'FINAL_POINTS', $a_set[
'final_max_points']);
144 $this->tpl->setVariable(
'FINAL_ID', $a_set[
'id']);
145 $this->tpl->setVariable(
'FINAL_LIMIT', $a_set[
'final_limit']);
148 $this->tpl->setVariable(
'TST_CSS',
ilUtil::switchColor($row_counter++,
'tblrow1',
'tblrow2'));
157 public function parse($a_objective_ids)
159 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
161 $objectives = array();
162 foreach ($a_objective_ids as $objective_id) {
169 foreach ($question_obj->getSelfAssessmentTests() as $tmp_test) {
170 if (isset(
$_POST[
'self'][$objective_id])) {
171 $objective_data[
'self_limit'] =
$_POST[
'self'][$objective_id];
173 $objective_data[
'self_limit'] = $tmp_test[
'limit'];
175 $questions = array();
176 foreach ($question_obj->getQuestionsOfTest($tmp_test[
'obj_id']) as $tmp_question) {
177 $qst[
'title'] = $tmp_question[
'title'];
178 $qst[
'description'] = $tmp_question[
'description'];
179 $qst[
'points'] = $tmp_question[
'points'];
183 $tst[
'questions'] = $questions;
189 $objective_data[
'self_tests'] =
$tests;
190 $objective_data[
'self_max_points'] = $question_obj->getSelfAssessmentPoints();
194 foreach ($question_obj->getFinalTests() as $tmp_test) {
195 if (isset(
$_POST[
'final'][$objective_id])) {
196 $objective_data[
'final_limit'] =
$_POST[
'final'][$objective_id];
198 $objective_data[
'final_limit'] = $tmp_test[
'limit'];
201 $questions = array();
202 foreach ($question_obj->getQuestionsOfTest($tmp_test[
'obj_id']) as $tmp_question) {
203 $qst[
'title'] = $tmp_question[
'title'];
204 $qst[
'description'] = $tmp_question[
'description'];
205 $qst[
'points'] = $tmp_question[
'points'];
209 $tst[
'questions'] = $questions;
216 $objective_data[
'final_tests'] =
$tests;
217 $objective_data[
'final_max_points'] = $question_obj->getFinalTestPoints();
219 $objective_data[
'id'] = $objective_id;
220 $objective_data[
'title'] = $objective->getTitle();
222 $objective_data[
'description'] = $objective->getDescription();
224 $objectives[] = $objective_data;
226 $this->
setData($objectives ? $objectives : array());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
parse($a_objective_ids)
parse
static _lookupTitle($a_id)
lookup object title
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
enable($a_module_name)
enables particular modules of table
__construct($a_parent_obj, $a_course_obj)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
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.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
class ilcourseobjectiveQuestion
setLimit($a_limit=0, $a_default_limit=0)