54 $this->
setId(
'tstAnswerStatistic');
56 $this->
setTitle($this->
DIC->language()->txt(
'tst_corrections_answers_tbl'));
58 $this->
setRowTemplate(
'tpl.tst_corrections_answer_row.html',
'Modules/Test');
60 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context =
'');
124 $this->
addColumn($this->
DIC->language()->txt(
'tst_corr_answ_stat_tbl_header_answer'),
'');
125 $this->
addColumn($this->
DIC->language()->txt(
'tst_corr_answ_stat_tbl_header_frequency'),
'');
128 if (isset(
$row[
'addable'])) {
138 $this->tpl->setCurrentBlock(
'answer');
140 $this->tpl->parseCurrentBlock();
142 $this->tpl->setCurrentBlock(
'frequency');
143 $this->tpl->setVariable(
'FREQUENCY',
$data[
'frequency']);
144 $this->tpl->parseCurrentBlock();
147 if (isset(
$data[
'addable'])) {
148 $this->tpl->setCurrentBlock(
'actions');
150 $this->tpl->parseCurrentBlock();
152 $this->tpl->setCurrentBlock(
'actions');
153 $this->tpl->touchBlock(
'actions');
154 $this->tpl->parseCurrentBlock();
166 $showModalButton->setId(
'btnShow_' . $uid);
167 $showModalButton->setCaption(
'tst_corr_add_as_answer_btn');
168 $showModalButton->setOnClick(
"$('#{$modal->getId()}').modal('show')");
174 $uiFactory = $this->
DIC->ui()->factory();
175 $uiRenderer = $this->
DIC->ui()->renderer();
177 $modal = $uiFactory->legacy($modal->getHTML());
178 $showModalButton = $uiFactory->legacy($showModalButton->render());
182 return $uiRenderer->render($showModalButton);
187 $formAction = $this->
DIC->ctrl()->getFormAction(
194 $form->setFormAction($formAction);
195 $form->setQuestionId($this->question->getId());
200 $bodyTpl =
new ilTemplate(
'tpl.tst_corr_addanswermodal.html',
true,
true,
'Modules/TestQuestionPool');
201 $bodyTpl->setVariable(
'BODY_UID', $uid);
202 $bodyTpl->setVariable(
'FORM',
$form->getHTML());
203 $bodyTpl->setVariable(
'JS_UID', $uid);
206 $modal->setId(
'modal_' . $uid);
207 $modal->setHeading($this->
DIC->language()->txt(
'tst_corr_add_as_answer_btn'));
209 $modal->setBody($bodyTpl->get());
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setActionsColumnEnabled(bool $actionsColumnEnabled)
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setAdditionalHtml(string $additionalHtml)
buildAddAnswerModalGui($uid, $data)
getParentObject()
Get parent object.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setQuestionIndex(int $questionIndex)
buildAddAnswerAction($data)
if(isset($_POST['submit'])) $form
special template class to simplify handling of ITX/PEAR
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct($a_parent_obj, $a_parent_cmd="", $question)
ilAnswerFrequencyStatisticTableGUI constructor.
static getInstance()
Get instance.
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.
addAdditionalHtml(string $additionalHtml)