Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

/**
* Class ilAssLongmenuCorrectionsInputGUI
*
Expand All @@ -27,6 +29,7 @@
class ilAssLongmenuCorrectionsInputGUI extends ilAnswerWizardInputGUI
{
private \ILIAS\DI\UIServices $ui;
private \ILIAS\UI\Component\Modal\Modal $modal;

public function __construct($a_title = "", $a_postvar = "")
{
Expand All @@ -50,12 +53,11 @@ public function insert(ilTemplate $a_tpl): void
$message = $inp->render();

$page = $this->ui->factory()->modal()->lightboxTextPage($message, $this->lng->txt('answer_options'));
$modal = $this->ui->factory()->modal()->lightbox($page);
$button = $this->ui->factory()->button()->standard($this->lng->txt('show'), $modal->getShowSignal());
$this->modal = $this->ui->factory()->modal()->lightbox($page);
$button = $this->ui->factory()->button()->standard($this->lng->txt('show'), $this->modal->getShowSignal());

$tpl = new ilTemplate('tst.longmenu_corrections_input.html', true, true, 'components/ILIAS/TestQuestionPool');

$tpl->setVariable('ANSWERS_MODAL', $this->ui->renderer()->render($modal));
$tpl->setVariable('TAG_INPUT', $this->buildTagInput()->render());
$tpl->setVariable('NUM_ANSWERS', $this->values['answers_all_count']);
$tpl->setVariable('BTN_SHOW', $this->ui->renderer()->render($button));
Expand All @@ -69,6 +71,11 @@ public function insert(ilTemplate $a_tpl): void
$a_tpl->parseCurrentBlock();
}

public function getContentOutsideFormTag(): string
{
return $this->ui->renderer()->render($this->modal);
}

protected function buildTagInput(): ilTagInputGUI
{
$tagInput = new ilTagInputGUI('', $this->getPostVar() . '_tags');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
<p>{TXT_ANSWERS} {NUM_ANSWERS} {BTN_SHOW}</p>
<p>{TXT_CORRECT_ANSWERS}</p>
{TAG_INPUT}
{ANSWERS_MODAL}
</div>
Loading