48 public function __construct($a_parent_obj, $a_parent_cmd =
"", $question =
"")
54 $this->
ui = $DIC->ui();
56 $this->
ctrl = $DIC->ctrl();
59 $this->
setId(
'tstAnswerStatistic');
63 $this->
setRowTemplate(
'tpl.tst_corrections_answer_row.html',
'Modules/Test');
129 $this->
addColumn($this->
language->txt(
'tst_corr_answ_stat_tbl_header_answer'),
'');
130 $this->
addColumn($this->
language->txt(
'tst_corr_answ_stat_tbl_header_frequency'),
'');
132 foreach ($this->
getData() as $row) {
133 if (isset($row[
'addable'])) {
143 $this->tpl->setCurrentBlock(
'answer');
145 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
'frequency');
148 $this->tpl->setVariable(
'FREQUENCY', $a_set[
'frequency']);
149 $this->tpl->parseCurrentBlock();
152 if (isset($a_set[
'addable'])) {
153 $this->tpl->setCurrentBlock(
'actions');
155 $this->tpl->parseCurrentBlock();
157 $this->tpl->setCurrentBlock(
'actions');
158 $this->tpl->touchBlock(
'actions');
159 $this->tpl->parseCurrentBlock();
166 $ui_factory = $this->
ui->factory();
167 $ui_renderer = $this->
ui->renderer();
171 $data[
'question_id'] = $this->question->getId();
174 $form = $answer_form_builder->buildAddAnswerForm(
$data);
175 $modal = $ui_factory->modal()->roundtrip($this->question->getTitleForHTMLOutput(), $form);
177 $show_modal_button = $ui_factory->button()->standard(
178 $this->
language->txt(
'tst_corr_add_as_answer_btn'),
179 $modal->getShowSignal()
184 return $ui_renderer->render($show_modal_button);
189 $purified_content = $this->getHtmlQuestionContentPurifier()->purify($content);
190 if ($this->isAdditionalContentEditingModePageObject()
191 || !(
new ilSetting(
'advanced_editing'))->
get(
'advanced_editing_javascript_editor') ===
'tinymce') {
192 $purified_content = nl2br($purified_content);
setActionsColumnEnabled(bool $actionsColumnEnabled)
RefineryFactory $refinery
Abstract basic class which is to be extended by the concrete assessment question type classes...
setAdditionalHtml(string $additionalHtml)
setQuestionIndex(int $questionIndex)
buildAddAnswerAction($data)
Provides fluid interface to RBAC services.
purifyAndPrepareTextAreaOutput(string $content)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static getInstanceByType(string $type)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
addAdditionalHtml(string $additionalHtml)
bool $actionsColumnEnabled
setPrefix(string $a_prefix)