24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
48 public function __construct($a_parent_obj, $a_parent_cmd, $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";
87 $this->
enable(
'select_all');
107 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
108 $ti =
new ilTextInputGUI($lng->txt(
"survey_question_title"),
"title");
110 $ti->setValidationRegexp(
'/^[^%]+$/is');
113 $ti->readFromSession();
114 $this->filter[
"title"] = $ti->getValue();
117 $ti =
new ilTextInputGUI($lng->txt(
"description"),
"description");
119 $ti->setValidationRegexp(
'/^[^%]+$/is');
122 $ti->readFromSession();
123 $this->filter[
"description"] = $ti->getValue();
128 $ti->setValidationRegexp(
'/^[^%]+$/is');
131 $ti->readFromSession();
132 $this->filter[
"author"] = $ti->getValue();
135 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
136 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php");
137 $types = ilObjSurveyQuestionPool::_getQuestionTypes();
139 $options[
""] = $lng->txt(
'filter_all_question_types');
140 foreach ($types as $translation =>
$row)
142 $options[
$row[
'type_tag']] = $translation;
146 $si->setOptions($options);
148 $si->readFromSession();
149 $this->filter[
"type"] =
$si->getValue();
153 $ti =
new ilTextInputGUI($lng->txt(
"survey_question_pool_title"),
"spl_txt");
157 $ti->readFromSession();
158 $this->filter[
"spl_txt"] = $ti->getValue();
162 $options[
""] = $lng->txt(
'filter_all_questionpools');
163 natcasesort($this->questionpools);
164 foreach ($this->questionpools as $obj_id =>
$title)
166 $options[$obj_id] =
$title;
169 $si->setOptions($options);
171 $si->readFromSession();
172 $this->filter[
"type"] =
$si->getValue();
186 $this->tpl->setVariable(
'QUESTION_ID',
$data[
"question_id"]);
189 $this->tpl->setVariable(
"TXT_PREVIEW", $this->lng->txt(
"preview"));
190 $guiclass = strtolower(
$data[
'type_tag']) .
"gui";
191 $this->ctrl->setParameterByClass($guiclass,
"q_id",
$data[
"question_id"]);
192 $this->tpl->setVariable(
"LINK_PREVIEW",
"ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&ref_id=" .
$data[
"ref_id"] .
"&cmd=preview&preview=" .
$data[
"question_id"]);
194 $this->tpl->setVariable(
"QUESTION_DESCRIPTION",
ilUtil::prepareFormOutput((strlen($data[
"description"])) ? $data[
"description"] :
""));
195 $this->tpl->setVariable(
"QUESTION_TYPE", $data[
"ttype"]);
204 $this->editable = $value;
214 $this->writeAccess = $value;