ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssQuestionPageCommandForwarder Class Reference
+ Collaboration diagram for ilAssQuestionPageCommandForwarder:

Public Member Functions

 getTestObj ()
 
 setTestObj ($testObj)
 
 forward ()
 

Protected Attributes

 $testObj
 

Detailed Description

Definition at line 13 of file class.ilAssQuestionPageCommandForwarder.php.

Member Function Documentation

◆ forward()

ilAssQuestionPageCommandForwarder::forward ( )

Definition at line 36 of file class.ilAssQuestionPageCommandForwarder.php.

References $_GET, $DIC, $lng, assQuestionGUI\_getQuestionGUI(), ilAssQuestionPreviewGUI\CMD_SHOW, ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getSyntaxStylePath(), getTestObj(), assQuestionGUI\RENDER_PURPOSE_PREVIEW, and ilUtil\sendFailure().

37  {
38  global $DIC;
39  $ctrl = $DIC->ctrl();
40  $lng = $DIC->language();
41  $ui = $DIC->ui()->mainTemplate();
42 
43  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
44  $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
45  $q_gui->setQuestionTabs();
46  $q_gui->outAdditionalOutput();
47  $q_gui->object->setObjId($this->getTestObj()->getId());
48  $question = &$q_gui->object;
49 
50 
51  if ($ctrl->getCmd() === 'edit' && $question->isInActiveTest()) {
52  ilUtil::sendFailure($lng->txt("question_is_part_of_running_test"), true);
53  $ctrl->redirectByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW);
54  }
55 
56  if ($_REQUEST['prev_qid']) {
57  $ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
58  }
59 
60  $_GET['calling_test'] = $this->getTestObj()->getRefId();
61  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
62  $ui->setCurrentBlock("ContentStyle");
63  $ui->setVariable(
64  "LOCATION_CONTENT_STYLESHEET",
66  );
67  $ui->parseCurrentBlock();
68 
69  // syntax style
70  $ui->setCurrentBlock("SyntaxStyle");
71  $ui->setVariable(
72  "LOCATION_SYNTAX_STYLESHEET",
74  );
75  $ui->parseCurrentBlock();
76  $ctrl->saveParameter($this, "q_id");
77  $lng->loadLanguageModule("content");
78  $ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
79  $ctrl->setReturnByClass("ilObjTestGUI", "questions");
80  $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
81  $page_gui->setEditPreview(true);
82  if (strlen($ctrl->getCmd()) == 0) {
83  $ctrl->setCmdClass(get_class($page_gui));
84  $ctrl->setCmd("preview");
85  }
86  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(true)));
87  $page_gui->setTemplateTargetVar("ADM_CONTENT");
88  $page_gui->setOutputMode($this->getTestObj()->evalTotalPersons() == 0 ? "edit" : 'preview');
89  $page_gui->setHeader($question->getTitle());
90  $page_gui->setPresentationTitle($question->getTitle() . ' [' . $DIC->language()->txt('question_id_short') . ': ' . $question->getId() . ']');
91 
92  $html = $ctrl->forwardCommand($page_gui);
93  $ui->setContent($html);
94  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
$_GET["client_id"]
Question page GUI class.
$lng
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
global $DIC
Definition: goto.php:24
static getSyntaxStylePath()
get syntax style path
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ getTestObj()

ilAssQuestionPageCommandForwarder::getTestObj ( )
Returns
ilObjTest

Definition at line 23 of file class.ilAssQuestionPageCommandForwarder.php.

References $testObj.

Referenced by forward().

+ Here is the caller graph for this function:

◆ setTestObj()

ilAssQuestionPageCommandForwarder::setTestObj (   $testObj)
Parameters
ilObjTest$testObj

Definition at line 31 of file class.ilAssQuestionPageCommandForwarder.php.

References $testObj.

Field Documentation

◆ $testObj

ilAssQuestionPageCommandForwarder::$testObj
protected

Definition at line 18 of file class.ilAssQuestionPageCommandForwarder.php.

Referenced by getTestObj(), and setTestObj().


The documentation for this class was generated from the following file: