4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
5 require_once
'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
70 public function __construct($a_parent_obj, $a_parent_cmd, $parentRefId)
72 $this->
setId(
'tst_qst_lst_' . $parentRefId);
74 parent::__construct($a_parent_obj, $a_parent_cmd);
77 $this->
setStyle(
'table',
'fullwidth');
81 $this->
setRowTemplate(
"tpl.il_as_tst_questions_row.html",
"Modules/Test");
83 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
97 'qid' => array(
'txt' => $this->lng->txt(
'question_id'),
'default' =>
true),
98 'description' => array(
'txt' => $this->lng->txt(
'description'),
'default' =>
false),
99 'author' => array(
'txt' => $this->lng->txt(
'author'),
'default' =>
false),
100 'working_time' => array(
'txt' => $this->lng->txt(
'working_time'),
'default' =>
false)
133 $this->
addColumn($this->lng->txt(
'question_id'),
'qid',
'');
136 $this->
addColumn($this->lng->txt(
"tst_question_title"),
'title',
'');
139 $this->
addColumn($this->lng->txt(
"obligatory"),
'obligatory',
'');
143 $this->
addColumn($this->lng->txt(
'description'),
'description',
'');
146 $this->
addColumn($this->lng->txt(
"tst_question_type"),
'type',
'');
150 $this->
addColumn($this->lng->txt(
'author'),
'author',
'');
156 $this->
addColumn($this->lng->txt(
'qpl'),
'qpl',
'');
166 $this->
addMultiCommand(
'removeQuestions', $this->lng->txt(
'remove_question'));
171 $this->
addMultiCommand(
'insertQuestionsBefore', $this->lng->txt(
'insert_before'));
172 $this->
addMultiCommand(
'insertQuestionsAfter', $this->lng->txt(
'insert_after'));
177 $this->
addMultiCommand(
'copyAndLinkToQuestionpool', $this->lng->txt(
'copy_and_link_to_questionpool'));
195 $this->tpl->setVariable(
"CHECKBOX_QID",
$data[
'question_id']);
199 $this->position += 10;
202 $this->tpl->setVariable(
"QUESTION_POSITION", $inputField);
203 $this->tpl->setVariable(
"POSITION_QID",
$data[
'question_id']);
207 $this->tpl->setVariable(
"QUESTION_ID_PRESENTATION",
$data[
'question_id']);
213 $this->tpl->setVariable(
"QUESTION_TITLE",
$data[
"title"]);
216 if (!
$data[
'complete']) {
218 $this->tpl->setVariable(
"ALT_WARNING", $this->lng->txt(
"warning_question_not_complete"));
219 $this->tpl->setVariable(
"TITLE_WARNING", $this->lng->txt(
"warning_question_not_complete"));
227 $this->tpl->setVariable(
"QUESTION_COMMENT",
$data[
"description"] ?
$data[
"description"] :
' ');
231 $this->tpl->setVariable(
"QUESTION_POINTS",
$data[
"points"]);
234 $this->tpl->setVariable(
"QUESTION_AUTHOR",
$data[
"author"]);
238 $this->tpl->setVariable(
"QUESTION_WORKING_TIME",
$data[
"working_time"]);
244 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
'tst_question_not_from_pool_info'));
258 $this->ctrl->setParameter($this->
getParentObject(),
'removeQid', $rowData[
'question_id']);
263 $button->setCaption(
'remove_question');
264 $button->setUrl($removeUrl);
266 return $button->render();
275 $this->ctrl->setParameter(
281 $this->ctrl->setParameter(
284 $rowData[
'question_id']
292 return '<a href="' . $questionHref .
'">' . $rowData[
"title"] .
'</a>';
301 if (!$rowData[
'obligationPossible']) {
310 $checkedAttr = $rowData[
'obligatory'] ?
'checked="checked"' :
'';
311 return '<input type="checkbox" name="obligatory[' . $rowData[
'question_id'] .
']" value="1" ' . $checkedAttr .
' />';
321 return '<input type="text" name="order[q_' . $questionId .
']" value="' .
$position .
'" maxlength="3" size="3" />';
330 return $this->lng->txt(
'saveOrderAndObligations');
334 return $this->lng->txt(
'saveObligations');
338 return $this->lng->txt(
'saveOrder');
341 return $this->lng->txt(
'save');
350 return $this->lng->txt(
'points') .
' (' . $this->
getTotalPoints() .
')';
353 return $this->lng->txt(
'points');
365 return $this->lng->txt(
'working_time');
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setQuestionManagingEnabled(bool $questionManagingEnabled)
buildQuestionTitleLink(array $rowData)
setQuestionTitleLinksEnabled(bool $questionTitleLinksEnabled)
isQuestionRemoveRowButtonEnabled()
setStyle($a_element, $a_style)
buildQuestionRemoveButton(array $rowData)
setObligatoryQuestionsHandlingEnabled(bool $obligatoryQuestionsHandlingEnabled)
$obligatoryQuestionsHandlingEnabled
setExternalSegmentation($a_val)
Set external segmentation.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static get($a_glyph, $a_text="")
Get glyph html.
static _lookupTitle($a_id)
lookup object title
setQuestionRemoveRowButtonEnabled(bool $questionRemoveRowButtonEnabled)
getParentCmd()
Get parent command.
getParentObject()
Get parent object.
static _getAllReferences($a_id)
get all reference ids of object
$questionRemoveRowButtonEnabled
$positionInsertCommandsEnabled
buildTableSaveCommandLabel()
setTotalWorkingTime(string $totalWorkingTime)
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setPositionInsertCommandsEnabled(bool $positionInsertCommandsEnabled)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
buildPositionInput($questionId, $position)
$questionPositioningEnabled
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
isTableSaveCommandRequired()
buildObligatoryColumnContent(array $rowData)
isQuestionTitleLinksEnabled()
setQuestionPositioningEnabled(bool $questionPositioningEnabled)
isQuestionPositioningEnabled()
isColumnSelected($a_col)
Is given column selected?
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
isQuestionManagingEnabled()
setFormName($a_formname="")
Set Form name.
isPositionInsertCommandsEnabled()
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
$questionTitleLinksEnabled
__construct($a_parent_obj, $a_parent_cmd, $parentRefId)
Constructor.
setTotalPoints(float $totalPoints)
isCheckboxColumnRequired()
isObligatoryQuestionsHandlingEnabled()