24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
50 public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access =
false, $a_checked_move =
false, $a_total = 0)
58 $this->total = $a_total;
64 $this->
setStyle(
'table',
'fullwidth');
67 $this->
addColumn($this->lng->txt(
"tst_question_title"),
'title',
'');
69 $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
70 $this->
addColumn($this->lng->txt(
"tst_question_type"),
'type',
'');
71 $this->
addColumn($this->lng->txt(
"points"),
'',
'');
72 $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
73 $this->
addColumn($this->lng->txt(
"qpl"),
'qpl',
'');
82 $this->
addMultiCommand(
'removeQuestions', $this->lng->txt(
'remove_question'));
84 if ($this->checked_move)
86 $this->
addMultiCommand(
'insertQuestionsBefore', $this->lng->txt(
'insert_before'));
87 $this->
addMultiCommand(
'insertQuestionsAfter', $this->lng->txt(
'insert_after'));
91 $this->
addMultiCommand(
'copyAndLinkToQuestionpool', $this->lng->txt(
'copy_and_link_to_questionpool'));
96 $this->
setRowTemplate(
"tpl.il_as_tst_questions_row.html",
"Modules/Test");
98 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
104 $this->
enable(
'select_all');
109 foreach ($this->column as $key => $column)
111 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
113 $this->column[$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
128 global $ilUser,$ilAccess;
130 $this->tpl->setVariable(
"QUESTION_ID",
$data[
"question_id"]);
133 if (!
$data[
'complete']) {
135 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
136 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
139 $q_id =
$data[
"question_id"];
141 $this->tpl->setVariable(
"QUESTION_TITLE",
"<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(),
"questions") .
"&eqid=$q_id&eqpl=$qpl_ref_id" .
"\">" .
$data[
"title"] .
"</a>");
145 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
147 $this->tpl->setVariable(
"QUESTION_SEQUENCE", $this->lng->txt(
"tst_sequence"));
151 if (
$data[
"sequence"] != 1)
153 $this->tpl->setVariable(
"BUTTON_UP",
"<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(),
"questions") .
"&up=".
$data[
"question_id"].
"\"><img src=\"" .
ilUtil::getImagePath(
"a_up.gif") .
"\" alt=\"" . $this->lng->txt(
"up") .
"\" border=\"0\" /></a>");
157 $this->tpl->setVariable(
"BUTTON_DOWN",
"<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(),
"questions") .
"&down=".
$data[
"question_id"].
"\"><img src=\"" .
ilUtil::getImagePath(
"a_down.gif") .
"\" alt=\"" . $this->lng->txt(
"down") .
"\" border=\"0\" /></a>");
160 $this->tpl->setVariable(
"QUESTION_COMMENT",
$data[
"description"]);
161 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
163 $this->tpl->setVariable(
"QUESTION_POINTS",
$data[
"points"]);
164 $this->totalPoints +=
$data[
"points"];
165 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
170 $this->tpl->setVariable(
"QUESTION_POOL",
' ');
174 $this->position += 10;
175 $field =
"<input type=\"text\" name=\"order[q_".$data[
"question_id"].
176 "]\" value=\"".$this->position.
"\" maxlength=\"3\" style=\"width:30px\" />";
177 $this->tpl->setVariable(
"QUESTION_POSITION", $field);
182 $this->writeAccess = $value;
192 $this->checked_move = $value;
202 $this->total = $value;