24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
48 public function __construct($a_parent_obj, $a_parent_cmd, $a_write_access =
false, $a_checked_move =
false, $a_total = 0)
56 $this->total = $a_total;
62 $this->
setStyle(
'table',
'fullwidth');
64 $this->
addColumn($this->lng->txt(
"question_id"),
'qid',
'');
65 $this->
addColumn($this->lng->txt(
"tst_question_title"),
'title',
'');
66 $this->
addColumn($this->lng->txt(
"tst_sequence"),
'sequence',
'');
67 $this->
addColumn($this->lng->txt(
"description"),
'description',
'');
68 $this->
addColumn($this->lng->txt(
"tst_question_type"),
'type',
'');
69 $this->
addColumn($this->lng->txt(
"points"),
'',
'');
70 $this->
addColumn($this->lng->txt(
"author"),
'author',
'');
71 $this->
addColumn($this->lng->txt(
"qpl"),
'qpl',
'');
78 $this->
addMultiCommand(
'removeQuestions', $this->lng->txt(
'remove_question'));
80 if ($this->checked_move)
82 $this->
addMultiCommand(
'insertQuestionsBefore', $this->lng->txt(
'insert_before'));
83 $this->
addMultiCommand(
'insertQuestionsAfter', $this->lng->txt(
'insert_after'));
88 $this->
setRowTemplate(
"tpl.il_as_tst_questions_row.html",
"Modules/Test");
90 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
94 $this->
enable(
'select_all');
99 foreach ($this->column as $key => $column)
101 if (strcmp($column[
'text'], $this->lng->txt(
"points")) == 0)
103 $this->column[$key][
'text'] = $this->lng->txt(
"points") .
" (" . $this->totalPoints .
")";
118 global $ilUser,$ilAccess;
119 $this->tpl->setVariable(
"QUESTION_ORIGINAL_ID",
$data[
"question_id"]);
120 $this->tpl->setVariable(
"QUESTION_ID",
$data[
"question_id"]);
123 $q_id =
$data[
"question_id"];
125 $this->tpl->setVariable(
"QUESTION_TITLE",
"<a href=\"" . $this->ctrl->getLinkTarget($this->getParentObject(),
"questions") .
"&eqid=$q_id&eqpl=$qpl_ref_id" .
"\">" .
$data[
"title"] .
"</a>");
129 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
131 $this->tpl->setVariable(
"QUESTION_SEQUENCE", $this->lng->txt(
"tst_sequence"));
135 if (
$data[
"sequence"] != 1)
137 $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>");
141 $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>");
144 $this->tpl->setVariable(
"QUESTION_COMMENT",
$data[
"description"]);
145 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
147 $this->tpl->setVariable(
"QUESTION_POINTS",
$data[
"points"]);
148 $this->totalPoints +=
$data[
"points"];
149 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
155 $this->writeAccess = $value;
165 $this->checked_move = $value;
175 $this->total = $value;