48 $main_template = $DIC->ui()->mainTemplate();
49 $lng = $DIC->language();
51 $this->testrequest = $DIC->test()->internal()->request();
54 if ($this->testrequest->raw(
'prev_qid')) {
55 $ctrl->setParameter($this,
'prev_qid', $this->testrequest->raw(
'prev_qid'));
58 $main_template->setCurrentBlock(
"ContentStyle");
59 $main_template->setVariable(
60 "LOCATION_CONTENT_STYLESHEET",
63 $main_template->parseCurrentBlock();
66 $main_template->setCurrentBlock(
"SyntaxStyle");
67 $main_template->setVariable(
68 "LOCATION_SYNTAX_STYLESHEET",
71 $main_template->parseCurrentBlock();
75 $q_gui->setQuestionTabs();
76 $q_gui->outAdditionalOutput();
78 $question = &$q_gui->object;
80 if ($ctrl->getCmd() ===
'edit' && $question->isInActiveTest()) {
81 $main_template->setOnScreenMessage(
'failure',
$lng->txt(
"question_is_part_of_running_test"));
85 $ctrl->saveParameter($this,
"q_id");
86 $lng->loadLanguageModule(
"content");
87 $ctrl->setReturnByClass(
"ilAssQuestionPageGUI",
"view");
88 $ctrl->setReturnByClass(
"ilObjTestGUI",
"questions");
92 if (strlen($ctrl->getCmd()) == 0) {
93 $ctrl->setCmdClass(get_class($page_gui));
94 $ctrl->setCmd(
"preview");
96 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(
true)));
97 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
98 $page_gui->setOutputMode($this->
getTestObj()->evalTotalPersons() == 0 ?
"edit" :
'preview');
99 $page_gui->setHeader($question->getTitleForHTMLOutput());
100 $page_gui->setPresentationTitle($question->getTitleForHTMLOutput() .
' [' .
$lng->txt(
'question_id_short') .
': ' . $question->getId() .
']');
102 $html = $ctrl->forwardCommand($page_gui);
103 $main_template->setContent($html);
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
setTestObj(ilObjTest $testObj)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
ILIAS Test InternalRequestService $testrequest
static getSyntaxStylePath()
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
const RENDER_PURPOSE_PREVIEW