4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
34 $this->
setId(
"qpl_qst_brows_" . $a_parent_obj->object->getRefId());
49 $this->
setStyle(
'table',
'fullwidth');
53 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
58 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
59 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
61 if (strcmp($c,
'points') == 0) $this->
addColumn($this->lng->txt(
"points"),
'points',
'',
false,
'ilCenterForced');
62 if (strcmp($c,
'statistics') == 0) $this->
addColumn($this->lng->txt(
'statistics'),
'',
'');
63 if (strcmp($c,
'author') == 0) $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
64 if (strcmp($c,
'created') == 0) $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
65 if (strcmp($c,
'tstamp') == 0) $this->
addColumn($this->lng->txt(
"last_update"),
'tstamp',
'');
71 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
75 if (strcmp($c,
'description') == 0) $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
76 if (strcmp($c,
'type') == 0) $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
84 $this->
addCommandButton(
'confirmDeleteQuestions', $this->lng->txt(
'confirm'));
103 $this->
setRowTemplate(
"tpl.il_as_qpl_questionbrowser_row.html",
"Modules/TestQuestionPool");
105 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
120 $this->
enable(
'select_all');
131 $cols[
"description"] = array(
132 "txt" => $lng->txt(
"description"),
135 $cols[
"type"] = array(
136 "txt" => $lng->txt(
"question_type"),
139 if (!$this->confirmdelete)
141 $cols[
"points"] = array(
142 "txt" => $lng->txt(
"points"),
145 $cols[
"statistics"] = array(
146 "txt" => $lng->txt(
"statistics"),
149 $cols[
"author"] = array(
150 "txt" => $lng->txt(
"author"),
153 $cols[
"created"] = array(
154 "txt" => $lng->txt(
"create_date"),
157 $cols[
"tstamp"] = array(
158 "txt" => $lng->txt(
"last_update"),
173 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
176 $ti->setValidationRegexp(
'/^[^%]+$/is');
179 $ti->readFromSession();
180 $this->filter[
"title"] = $ti->getValue();
183 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
186 $ti->setValidationRegexp(
'/^[^%]+$/is');
188 $ti->readFromSession();
189 $this->filter[
"description"] = $ti->getValue();
191 if (!$this->confirmdelete)
197 $ti->setValidationRegexp(
'/^[^%]+$/is');
199 $ti->readFromSession();
200 $this->filter[
"author"] = $ti->getValue();
203 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
204 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
207 $options[
""] = $lng->txt(
'filter_all_question_types');
208 foreach ($types as $translation =>
$row)
216 $si->readFromSession();
217 $this->filter[
"type"] =
$si->getValue();
219 if( $this->parent_obj->object->getShowTaxonomies() )
221 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
223 foreach($this->taxIds as $taxId)
225 if( $taxId == $this->parent_obj->object->getNavTaxonomyId() )
230 $postvar =
"tax_$taxId";
234 $inp->readFromSession();
235 $this->filter[$postvar] = $inp->getValue();
243 foreach ($this->column as $key => $column)
245 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
247 $this->column[$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
263 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
264 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
266 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$data[
"question_id"]);
267 $this->ctrl->setParameterByClass($class,
"q_id",
$data[
"question_id"]);
270 if (!$this->confirmdelete)
272 $this->tpl->setCurrentBlock(
'checkbox');
273 $this->tpl->setVariable(
'CB_QUESTION_ID',
$data[
"question_id"]);
274 $this->tpl->parseCurrentBlock();
278 $this->tpl->setCurrentBlock(
"edit_link");
279 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
280 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"));
281 $this->tpl->parseCurrentBlock();
283 if (
$data[
"complete"] == 0)
285 $this->tpl->setCurrentBlock(
"qpl_warning");
287 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
288 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
289 $this->tpl->parseCurrentBlock();
293 $points =
$data[
"points"];
295 $this->totalPoints += $points;
299 if (strcmp($c,
'points') == 0)
301 $this->tpl->setCurrentBlock(
'points');
302 $this->tpl->setVariable(
"QUESTION_POINTS", $points);
303 $this->tpl->parseCurrentBlock();
305 if (strcmp($c,
'statistics') == 0)
307 $this->tpl->setCurrentBlock(
'statistics');
308 $this->tpl->setVariable(
"LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass($class,
"assessment"));
309 $this->tpl->setVariable(
"TXT_ASSESSMENT", $this->lng->txt(
"statistics"));
310 include_once
"./Services/Utilities/classes/class.ilUtil.php";
311 $this->tpl->setVariable(
"IMG_ASSESSMENT",
ilUtil::getImagePath(
"assessment.gif",
"Modules/TestQuestionPool"));
312 $this->tpl->parseCurrentBlock();
314 if (strcmp($c,
'author') == 0)
316 $this->tpl->setCurrentBlock(
'author');
317 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
318 $this->tpl->parseCurrentBlock();
320 if(strcmp($c,
'created') == 0)
322 $this->tpl->setCurrentBlock(
'created');
324 $this->tpl->parseCurrentBlock();
326 if(strcmp($c,
'tstamp') == 0)
328 $this->tpl->setCurrentBlock(
'updated');
330 $this->tpl->parseCurrentBlock();
333 $this->tpl->setCurrentBlock(
'preview');
334 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
335 $this->tpl->setVariable(
"LINK_PREVIEW", $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"preview"));
336 $this->tpl->parseCurrentBlock();
340 $this->tpl->setCurrentBlock(
'hidden');
341 $this->tpl->setVariable(
'HIDDEN_QUESTION_ID',
$data[
"question_id"]);
342 $this->tpl->parseCurrentBlock();
347 if (strcmp($c,
'description') == 0)
349 $this->tpl->setCurrentBlock(
'description');
350 $this->tpl->setVariable(
"QUESTION_COMMENT", (strlen(
$data[
"description"])) ?
$data[
"description"] :
" ");
351 $this->tpl->parseCurrentBlock();
353 if (strcmp($c,
'type') == 0)
355 $this->tpl->setCurrentBlock(
'type');
357 $this->tpl->parseCurrentBlock();
360 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
361 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
366 $this->editable = $value;
376 $this->writeAccess = $value;
390 if(in_array($column, array(
'points',
'created',
'tstamp')))