24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
48 $this->course_obj = $a_course_obj;
51 $this->lng->loadLanguageModule(
'crs');
54 parent::__construct($a_parent_obj,
'questionOverview');
56 $this->
addColumn($this->lng->txt(
'title'),
'title',
'33%');
57 $this->
addColumn($this->lng->txt(
'crs_objective_self_assessment'),
'self',
'33%%');
58 $this->
addColumn($this->lng->txt(
'crs_objective_final_test'),
'final',
'33%');
60 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
61 $this->
setRowTemplate(
"tpl.crs_questions_table_row.html",
"Modules/Course");
65 $this->
enable(
'select_all');
80 static $row_counter = 1;
82 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
83 if (strlen($a_set[
'description'])) {
84 $this->tpl->setVariable(
'VAL_DESC', $a_set[
'description']);
87 foreach ($a_set[
'self_tests'] as $tst) {
88 foreach ($tst[
'questions'] as $qst) {
89 $this->tpl->setCurrentBlock(
'self_qst');
90 $this->tpl->setVariable(
'SELF_QST_TITLE', $qst[
'title']);
91 if (strlen($qst[
'description'])) {
92 $this->tpl->setVariable(
'SELF_QST_DESCRIPTION', $qst[
'description']);
94 $this->tpl->setVariable(
'SELF_QST_POINTS', $qst[
'points']);
95 $this->tpl->setVariable(
'SELF_QST_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
96 $this->tpl->parseCurrentBlock();
98 $this->tpl->setCurrentBlock(
'self_tst');
99 $this->tpl->setVariable(
'SELF_TST_TITLE', $tst[
'title']);
100 if (strlen($tst[
'description'])) {
101 $this->tpl->setVariable(
'SELF_TST_DESC', $tst[
'description']);
104 $this->tpl->setVariable(
'SELF_TYPE_ALT', $this->lng->txt(
'obj_tst'));
105 $this->tpl->parseCurrentBlock();
107 if (count($a_set[
'self_tests'])) {
108 $this->tpl->setVariable(
'SELF_TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
109 $this->tpl->setVariable(
'SELF_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
110 $this->tpl->setVariable(
'SELF_TXT_REQ_POINTS', $this->lng->txt(
'crs_obj_required_points'));
111 $this->tpl->setVariable(
'SELF_POINTS', $a_set[
'self_max_points']);
112 $this->tpl->setVariable(
'SELF_ID', $a_set[
'id']);
113 $this->tpl->setVariable(
'SELF_LIMIT', $a_set[
'self_limit']);
116 foreach ($a_set[
'final_tests'] as $tst) {
117 foreach ($tst[
'questions'] as $qst) {
118 $this->tpl->setCurrentBlock(
'final_qst');
119 $this->tpl->setVariable(
'FINAL_QST_TITLE', $qst[
'title']);
120 if (strlen($qst[
'description'])) {
121 $this->tpl->setVariable(
'FINAL_QST_DESCRIPTION', $qst[
'description']);
123 $this->tpl->setVariable(
'FINAL_QST_POINTS', $qst[
'points']);
124 $this->tpl->setVariable(
'FINAL_QST_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
125 $this->tpl->parseCurrentBlock();
127 $this->tpl->setCurrentBlock(
'final_tst');
128 $this->tpl->setVariable(
'FINAL_TST_TITLE', $tst[
'title']);
129 if (strlen($tst[
'description'])) {
130 $this->tpl->setVariable(
'FINAL_TST_DESC', $tst[
'description']);
133 $this->tpl->setVariable(
'FINAL_TYPE_ALT', $this->lng->txt(
'obj_tst'));
134 $this->tpl->parseCurrentBlock();
136 if (count($a_set[
'final_tests'])) {
137 $this->tpl->setVariable(
'FINAL_TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
138 $this->tpl->setVariable(
'FINAL_TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
139 $this->tpl->setVariable(
'FINAL_TXT_REQ_POINTS', $this->lng->txt(
'crs_obj_required_points'));
140 $this->tpl->setVariable(
'FINAL_POINTS', $a_set[
'final_max_points']);
141 $this->tpl->setVariable(
'FINAL_ID', $a_set[
'id']);
142 $this->tpl->setVariable(
'FINAL_LIMIT', $a_set[
'final_limit']);
145 $this->tpl->setVariable(
'TST_CSS',
ilUtil::switchColor($row_counter++,
'tblrow1',
'tblrow2'));
154 public function parse($a_objective_ids)
156 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
158 $objectives =
array();
159 foreach ($a_objective_ids as $objective_id) {
166 foreach ($question_obj->getSelfAssessmentTests() as $tmp_test) {
167 if (isset(
$_POST[
'self'][$objective_id])) {
168 $objective_data[
'self_limit'] =
$_POST[
'self'][$objective_id];
170 $objective_data[
'self_limit'] = $tmp_test[
'limit'];
172 $questions =
array();
173 foreach ($question_obj->getQuestionsOfTest($tmp_test[
'obj_id']) as $tmp_question) {
174 $qst[
'title'] = $tmp_question[
'title'];
175 $qst[
'description'] = $tmp_question[
'description'];
176 $qst[
'points'] = $tmp_question[
'points'];
180 $tst[
'questions'] = $questions;
186 $objective_data[
'self_tests'] = $tests;
187 $objective_data[
'self_max_points'] = $question_obj->getSelfAssessmentPoints();
191 foreach ($question_obj->getFinalTests() as $tmp_test) {
192 if (isset(
$_POST[
'final'][$objective_id])) {
193 $objective_data[
'final_limit'] =
$_POST[
'final'][$objective_id];
195 $objective_data[
'final_limit'] = $tmp_test[
'limit'];
198 $questions =
array();
199 foreach ($question_obj->getQuestionsOfTest($tmp_test[
'obj_id']) as $tmp_question) {
200 $qst[
'title'] = $tmp_question[
'title'];
201 $qst[
'description'] = $tmp_question[
'description'];
202 $qst[
'points'] = $tmp_question[
'points'];
206 $tst[
'questions'] = $questions;
213 $objective_data[
'final_tests'] = $tests;
214 $objective_data[
'final_max_points'] = $question_obj->getFinalTestPoints();
216 $objective_data[
'id'] = $objective_id;
217 $objective_data[
'title'] = $objective->getTitle();
219 $objective_data[
'description'] = $objective->getDescription();
221 $objectives[] = $objective_data;
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.
Create styles array
The data for the language used.
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)