4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
36 $this->
setId(
"qpl_qst_brows_" . $a_parent_obj->object->getRefId());
51 $this->
setStyle(
'table',
'fullwidth');
55 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
60 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
61 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
63 if (strcmp($c,
'points') == 0) $this->
addColumn($this->lng->txt(
"points"),
'points',
'',
false,
'ilCenterForced');
64 if (strcmp($c,
'statistics') == 0) $this->
addColumn($this->lng->txt(
'statistics'),
'',
'');
65 if (strcmp($c,
'author') == 0) $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
66 if (strcmp($c,
'created') == 0) $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
67 if (strcmp($c,
'tstamp') == 0) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
68 if (strcmp($c,
'working_time') == 0) $this->
addColumn($this->lng->txt(
"working_time"),
'working_time',
'');
74 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
78 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
79 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
87 $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
106 $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html",
"Modules/TestQuestionPool");
108 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
123 $this->
enable(
'select_all');
134 $cols[
"description"] = array(
135 "txt" => $lng->txt(
"description"),
138 $cols[
"type"] = array(
139 "txt" => $lng->txt(
"question_type"),
142 if (!$this->confirmdelete)
144 $cols[
"points"] = array(
145 "txt" => $lng->txt(
"points"),
148 $cols[
"statistics"] = array(
149 "txt" => $lng->txt(
"statistics"),
152 $cols[
"author"] = array(
153 "txt" => $lng->txt(
"author"),
156 $cols[
"created"] = array(
157 "txt" => $lng->txt(
"create_date"),
160 $cols[
"tstamp"] = array(
161 "txt" => $lng->txt(
"last_update"),
164 $cols[
"working_time"] = array(
165 "txt" => $lng->txt(
"working_time"),
180 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
183 $ti->setValidationRegexp(
'/^[^%]+$/is');
186 $ti->readFromSession();
187 $this->filter[
"title"] = $ti->getValue();
190 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
193 $ti->setValidationRegexp(
'/^[^%]+$/is');
195 $ti->readFromSession();
196 $this->filter[
"description"] = $ti->getValue();
198 if (!$this->confirmdelete)
204 $ti->setValidationRegexp(
'/^[^%]+$/is');
206 $ti->readFromSession();
207 $this->filter[
"author"] = $ti->getValue();
210 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
211 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
214 $options[
""] = $lng->txt(
'filter_all_question_types');
215 foreach ($types as $translation =>
$row)
223 $si->readFromSession();
224 $this->filter[
"type"] =
$si->getValue();
226 if( $this->parent_obj->object->getShowTaxonomies() )
228 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
230 foreach($this->taxIds as $taxId)
232 if( $taxId == $this->parent_obj->object->getNavTaxonomyId() )
237 $postvar =
"tax_$taxId";
241 $inp->readFromSession();
242 $this->filter[$postvar] = $inp->getValue();
250 foreach ($this->column as $key => $column)
252 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
254 $this->column[$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
256 elseif (strcmp($column[
'text'], $this->lng->txt(
"working_time")) == 0)
258 $this->column[$key][
'text'] = $this->lng->txt(
"working_time") .
" (" . $this->totalWorkingTime .
")";
274 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
275 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
277 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$data[
"question_id"]);
278 $this->ctrl->setParameterByClass(
"ilAssQuestionPreviewGUI",
"q_id",
$data[
"question_id"]);
279 $this->ctrl->setParameterByClass($class,
"q_id",
$data[
"question_id"]);
282 if (!$this->confirmdelete)
284 $this->tpl->setCurrentBlock(
'checkbox');
285 $this->tpl->setVariable(
'CB_QUESTION_ID',
$data[
"question_id"]);
286 $this->tpl->parseCurrentBlock();
291 $href = $this->ctrl->getLinkTargetByClass(
$data[
'type_tag'].
'GUI',
'editQuestion');
293 $this->tpl->setCurrentBlock(
"edit_link");
294 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
295 $this->tpl->setVariable(
"LINK_EDIT", $href);
296 $this->tpl->parseCurrentBlock();
298 if (
$data[
"complete"] == 0)
300 $this->tpl->setCurrentBlock(
"qpl_warning");
302 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
303 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
304 $this->tpl->parseCurrentBlock();
308 $points =
$data[
"points"];
311 $this->totalPoints += $points;
315 if (strcmp($c,
'points') == 0)
317 $this->tpl->setCurrentBlock(
'points');
318 $this->tpl->setVariable(
"QUESTION_POINTS", $points);
319 $this->tpl->parseCurrentBlock();
321 if (strcmp($c,
'statistics') == 0)
323 $this->tpl->setCurrentBlock(
'statistics');
324 $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class,
"assessment"));
325 $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
326 include_once
"./Services/Utilities/classes/class.ilUtil.php";
327 $this->tpl->setVariable(
"IMG_ASSESSMENT",
ilUtil::getImagePath(
"assessment.gif",
"Modules/TestQuestionPool"));
328 $this->tpl->parseCurrentBlock();
330 if (strcmp($c,
'author') == 0)
332 $this->tpl->setCurrentBlock(
'author');
333 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
334 $this->tpl->parseCurrentBlock();
336 if(strcmp($c,
'created') == 0)
338 $this->tpl->setCurrentBlock(
'created');
340 $this->tpl->parseCurrentBlock();
342 if(strcmp($c,
'tstamp') == 0)
344 $this->tpl->setCurrentBlock(
'updated');
346 $this->tpl->parseCurrentBlock();
348 if(strcmp($c,
'working_time') == 0)
350 $this->tpl->setCurrentBlock(
'working_time');
351 $this->tpl->setVariable(
'WORKING_TIME',
$data[
"working_time"]);
352 $this->tpl->parseCurrentBlock();
356 $this->tpl->setCurrentBlock(
'preview');
357 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
359 $this->tpl->parseCurrentBlock();
363 $this->tpl->setCurrentBlock(
'hidden');
364 $this->tpl->setVariable(
'HIDDEN_QUESTION_ID',
$data[
"question_id"]);
365 $this->tpl->parseCurrentBlock();
370 if (strcmp($c,
'description') == 0)
372 $this->tpl->setCurrentBlock(
'description');
373 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
374 $this->tpl->parseCurrentBlock();
376 if (strcmp($c,
'type') == 0)
378 $this->tpl->setCurrentBlock(
'type');
380 $this->tpl->parseCurrentBlock();
383 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
384 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
389 $this->editable = $value;
399 $this->writeAccess = $value;
413 if(in_array($column, array(
'points',
'created',
'tstamp')))