4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
44 $this->
setStyle(
'table',
'fullwidth');
48 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
53 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
54 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
55 if (strcmp($c,
'points') == 0) $this->
addColumn($this->lng->txt(
"points"),
'points',
'',
false,
'right');
56 if (strcmp($c,
'statistics') == 0) $this->
addColumn($this->lng->txt(
'statistics'),
'',
'');
57 if (strcmp($c,
'author') == 0) $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
58 if (strcmp($c,
'created') == 0) $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
59 if (strcmp($c,
'tstamp') == 0) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
67 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
71 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
72 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
80 $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
91 if (array_key_exists(
"qpl_clipboard",
$_SESSION))
99 $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html",
"Modules/TestQuestionPool");
101 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
114 $this->
enable(
'select_all');
125 $cols[
"description"] = array(
126 "txt" => $lng->txt(
"description"),
129 $cols[
"type"] = array(
130 "txt" => $lng->txt(
"question_type"),
133 if (!$this->confirmdelete)
135 $cols[
"points"] = array(
136 "txt" => $lng->txt(
"points"),
139 $cols[
"statistics"] = array(
140 "txt" => $lng->txt(
"statistics"),
143 $cols[
"author"] = array(
144 "txt" => $lng->txt(
"author"),
147 $cols[
"created"] = array(
148 "txt" => $lng->txt(
"create_date"),
151 $cols[
"tstamp"] = array(
152 "txt" => $lng->txt(
"last_update"),
164 global
$lng, $rbacreview, $ilUser;
167 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
170 $ti->setValidationRegexp(
'/^[^%]+$/is');
173 $ti->readFromSession();
174 $this->filter[
"title"] = $ti->getValue();
177 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
180 $ti->setValidationRegexp(
'/^[^%]+$/is');
182 $ti->readFromSession();
183 $this->filter[
"description"] = $ti->getValue();
185 if (!$this->confirmdelete)
191 $ti->setValidationRegexp(
'/^[^%]+$/is');
193 $ti->readFromSession();
194 $this->filter[
"author"] = $ti->getValue();
197 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
198 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
201 $options[
""] = $lng->txt(
'filter_all_question_types');
202 foreach ($types as $translation =>
$row)
204 $options[
$row[
'type_tag']] = $translation;
210 $si->readFromSession();
211 $this->filter[
"type"] = $si->getValue();
217 foreach ($this->column as $key => $column)
219 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
221 $this->column[$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
236 global $ilUser,$ilAccess;
237 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
238 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
240 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id",
$data[
"question_id"]);
241 $this->ctrl->setParameterByClass($class,
"q_id",
$data[
"question_id"]);
244 if (!$this->confirmdelete)
246 $this->tpl->setCurrentBlock(
'checkbox');
247 $this->tpl->setVariable(
'CB_QUESTION_ID',
$data[
"question_id"]);
248 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
"edit_link");
253 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
254 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"edit"));
255 $this->tpl->parseCurrentBlock();
257 if (
$data[
"complete"] == 0)
259 $this->tpl->setCurrentBlock(
"qpl_warning");
261 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
262 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
263 $this->tpl->parseCurrentBlock();
267 $points =
$data[
"points"];
269 $this->totalPoints += $points;
273 if (strcmp($c,
'points') == 0)
275 $this->tpl->setCurrentBlock(
'points');
276 $this->tpl->setVariable(
"QUESTION_POINTS", $points);
277 $this->tpl->parseCurrentBlock();
279 if (strcmp($c,
'statistics') == 0)
281 $this->tpl->setCurrentBlock(
'statistics');
282 $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class,
"assessment"));
283 $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
284 include_once
"./Services/Utilities/classes/class.ilUtil.php";
285 $this->tpl->setVariable(
"IMG_ASSESSMENT",
ilUtil::getImagePath(
"assessment.gif",
"Modules/TestQuestionPool"));
286 $this->tpl->parseCurrentBlock();
288 if (strcmp($c,
'author') == 0)
290 $this->tpl->setCurrentBlock(
'author');
291 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
292 $this->tpl->parseCurrentBlock();
294 include_once
"./classes/class.ilFormat.php";
295 if (strcmp($c,
'created') == 0)
297 $this->tpl->setCurrentBlock(
'created');
299 $this->tpl->parseCurrentBlock();
301 if (strcmp($c,
'tstamp') == 0)
303 $this->tpl->setCurrentBlock(
'updated');
305 $this->tpl->parseCurrentBlock();
308 $this->tpl->setCurrentBlock(
'preview');
309 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
310 $this->tpl->setVariable(
"LINK_PREVIEW", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"preview"));
311 $this->tpl->parseCurrentBlock();
315 $this->tpl->setCurrentBlock(
'hidden');
316 $this->tpl->setVariable(
'HIDDEN_QUESTION_ID',
$data[
"question_id"]);
317 $this->tpl->parseCurrentBlock();
322 if (strcmp($c,
'description') == 0)
324 $this->tpl->setCurrentBlock(
'description');
325 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
326 $this->tpl->parseCurrentBlock();
328 if (strcmp($c,
'type') == 0)
330 $this->tpl->setCurrentBlock(
'type');
332 $this->tpl->parseCurrentBlock();
335 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
336 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
341 $this->editable = $value;
351 $this->writeAccess = $value;