24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
48 public function __construct($a_parent_obj, $a_parent_cmd, $a_object, $a_write_access =
false)
60 $this->
setStyle(
'table',
'fullwidth');
62 $this->
addColumn($this->lng->txt(
"title"),
'title',
'');
64 $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
65 $this->
addColumn($this->lng->txt(
"question_type"),
'ttype',
'');
66 $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
67 $this->
addColumn($this->lng->txt(
"create_date"),
'created',
'');
68 $this->
addColumn($this->lng->txt(
"last_update"),
'updated',
'');
69 $this->
addColumn($this->lng->txt(
"obj_spl"),
'spl',
'');
76 $this->
setRowTemplate(
"tpl.il_svy_svy_questionbrowser_row.html",
"Modules/Survey");
78 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
81 include_once
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
86 $this->
enable(
'select_all');
99 if ($item->getValue() !==
false)
101 $arrFilter[$item->getPostVar()] = $item->getValue();
104 $data = $a_object->getQuestionsTable($arrFilter);
112 $data[$idx][
"spl"] = $pools[
$row[
"obj_fi"]];
132 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
133 $ti =
new ilTextInputGUI($lng->txt(
"survey_question_title"),
"title");
135 $ti->setValidationRegexp(
'/^[^%]+$/is');
138 $ti->readFromSession();
139 $this->filter[
"title"] = $ti->getValue();
142 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
144 $ti->setValidationRegexp(
'/^[^%]+$/is');
147 $ti->readFromSession();
148 $this->filter[
"description"] = $ti->getValue();
153 $ti->setValidationRegexp(
'/^[^%]+$/is');
156 $ti->readFromSession();
157 $this->filter[
"author"] = $ti->getValue();
160 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
161 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php");
162 $types = ilObjSurveyQuestionPool::_getQuestionTypes();
164 $options[
""] = $lng->txt(
'filter_all_question_types');
165 foreach ($types as $translation =>
$row)
173 $si->readFromSession();
174 $this->filter[
"type"] =
$si->getValue();
178 $ti =
new ilTextInputGUI($lng->txt(
"survey_question_pool_title"),
"spl_txt");
182 $ti->readFromSession();
183 $this->filter[
"spl_txt"] = $ti->getValue();
187 $options[
""] = $lng->txt(
'filter_all_questionpools');
188 natcasesort($this->questionpools);
189 foreach ($this->questionpools as $obj_id =>
$title)
196 $si->readFromSession();
197 $this->filter[
"type"] =
$si->getValue();
211 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
214 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
215 $guiclass = strtolower(
$data[
'type_tag']) .
"gui";
216 $this->ctrl->setParameterByClass($guiclass,
"q_id",
$data[
"question_id"]);
217 $this->tpl->setVariable(
"LINK_PREVIEW",
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&ref_id=" .
$data[
"ref_id"] .
"&cmd=preview&preview=" .
$data[
"question_id"]);
219 $this->tpl->setVariable(
"QUESTION_DESCRIPTION",
ilUtil::prepareFormOutput((strlen($data[
"description"])) ? $data[
"description"] :
""));
220 $this->tpl->setVariable(
"QUESTION_TYPE", $data[
"ttype"]);
229 $this->editable = $value;
239 $this->writeAccess = $value;