24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
63 $this->
setId(
"qplqst".$a_parent_obj->object->getId());
65 $this->
setStyle(
'table',
'fullwidth');
69 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
72 $this->browsercolumns[
'description'] = $qplSetting->get(
"description", 1) ?
true :
false;
73 $this->browsercolumns[
'type'] = $qplSetting->get(
"type", 1) ?
true :
false;
74 $this->browsercolumns[
'points'] = $qplSetting->get(
"points", 1) ?
true :
false;
75 $this->browsercolumns[
'statistics'] = $qplSetting->get(
"statistics", 1) ?
true :
false;
76 $this->browsercolumns[
'author'] = $qplSetting->get(
"author", 1) ?
true :
false;
77 $this->browsercolumns[
'created'] = $qplSetting->get(
"created", 1) ?
true :
false;
78 $this->browsercolumns[
'updated'] = $qplSetting->get(
"updated", 1) ?
true :
false;
79 if ($this->browsercolumns[
'description']) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
80 if ($this->browsercolumns[
'type']) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
81 if ($this->browsercolumns[
'points']) $this->
addColumn($this->lng->txt(
"points"),
'',
'',
false,
'right');
82 if ($this->browsercolumns[
'statistics']) $this->
addColumn(
'',
'statistics',
'');
83 if ($this->browsercolumns[
'author']) $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
84 if ($this->browsercolumns[
'created']) $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
85 if ($this->browsercolumns[
'updated']) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
92 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
94 $this->browsercolumns[
'description'] = $qplSetting->get(
"description", 1) ?
true :
false;
95 $this->browsercolumns[
'type'] = $qplSetting->get(
"type", 1) ?
true :
false;
96 if ($this->browsercolumns[
'description']) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
97 if ($this->browsercolumns[
'type']) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
104 $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
105 $this->
addCommandButton(
'cancelDeleteQuestions', $this->lng->txt(
'cancel'));
115 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
123 $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html",
"Modules/TestQuestionPool");
125 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
138 $this->
enable(
'select_all');
151 global
$lng, $rbacreview, $ilUser;
154 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
158 $ti->setValidationRegexp(
'/^[^%]+$/is');
160 $ti->readFromSession();
161 $this->filter[
"title"] = $ti->getValue();
164 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
167 $ti->setValidationRegexp(
'/^[^%]+$/is');
169 $ti->readFromSession();
170 $this->filter[
"description"] = $ti->getValue();
175 $ti->setValidationRegexp(
'/^[^%]+$/is');
178 $ti->readFromSession();
179 $this->filter[
"author"] = $ti->getValue();
182 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
183 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
186 $options[
""] = $lng->txt(
'filter_all_question_types');
187 foreach ($types as $translation =>
$row)
189 $options[
$row[
'type_tag']] = $translation;
195 $si->readFromSession();
196 $this->filter[
"type"] = $si->getValue();
202 foreach ($this->column as
$key => $column)
204 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
206 $this->column[
$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
221 global $ilUser,$ilAccess;
222 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
223 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
225 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id",
$data[
"question_id"]);
226 $this->ctrl->setParameterByClass($class,
"q_id",
$data[
"question_id"]);
229 if (!$this->confirmdelete)
231 $this->tpl->setCurrentBlock(
'checkbox');
232 $this->tpl->setVariable(
'CB_QUESTION_ID',
$data[
"question_id"]);
233 $this->tpl->parseCurrentBlock();
237 $this->tpl->setCurrentBlock(
"edit_link");
238 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
239 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"edit"));
240 $this->tpl->parseCurrentBlock();
242 if (
$data[
"complete"] == 0)
244 $this->tpl->setCurrentBlock(
"qpl_warning");
246 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
247 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
248 $this->tpl->parseCurrentBlock();
256 if ($this->browsercolumns[
'points'])
258 $this->tpl->setCurrentBlock(
'points');
259 $this->tpl->setVariable(
"QUESTION_POINTS",
$points);
260 $this->tpl->parseCurrentBlock();
262 if ($this->browsercolumns[
'statistics'])
264 $this->tpl->setCurrentBlock(
'statistics');
265 $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class,
"assessment"));
266 $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
267 include_once
"./Services/Utilities/classes/class.ilUtil.php";
268 $this->tpl->setVariable(
"IMG_ASSESSMENT",
ilUtil::getImagePath(
"assessment.gif",
"Modules/TestQuestionPool"));
269 $this->tpl->parseCurrentBlock();
271 if ($this->browsercolumns[
'author'])
273 $this->tpl->setCurrentBlock(
'author');
274 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
275 $this->tpl->parseCurrentBlock();
277 include_once
"./classes/class.ilFormat.php";
278 if ($this->browsercolumns[
'created'])
280 $this->tpl->setCurrentBlock(
'created');
282 $this->tpl->parseCurrentBlock();
284 if ($this->browsercolumns[
'updated'])
286 $this->tpl->setCurrentBlock(
'updated');
288 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
'preview');
291 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
292 $this->tpl->setVariable(
"LINK_PREVIEW", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"preview"));
293 $this->tpl->parseCurrentBlock();
297 $this->tpl->setCurrentBlock(
'hidden');
298 $this->tpl->setVariable(
'HIDDEN_QUESTION_ID',
$data[
"question_id"]);
299 $this->tpl->parseCurrentBlock();
303 if ($this->browsercolumns[
'description'])
305 $this->tpl->setCurrentBlock(
'description');
306 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
307 $this->tpl->parseCurrentBlock();
309 if ($this->browsercolumns[
'type'])
311 $this->tpl->setCurrentBlock(
'type');
313 $this->tpl->parseCurrentBlock();
316 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
317 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
322 $this->editable = $value;
332 $this->writeAccess = $value;