ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $html, assQuestionGUI\_getQuestionGUI(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getSyntaxStylePath(), getTestObj(), and assQuestionGUI\RENDER_PURPOSE_PREVIEW.

37  {
38  global $DIC; /* @var ILIAS\DI\Container $DIC */
39 
40  require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
41  //echo $_REQUEST['prev_qid'];
42  if ($_REQUEST['prev_qid']) {
43  $DIC->ctrl()->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
44  }
45 
46  //global $___test_express_mode;
47  //$___test_express_mode = true;
48  $_GET['calling_test'] = $this->getTestObj()->getRefId();
49  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
50  $DIC->ui()->mainTemplate()->setCurrentBlock("ContentStyle");
51  $DIC->ui()->mainTemplate()->setVariable(
52  "LOCATION_CONTENT_STYLESHEET",
54  );
55  $DIC->ui()->mainTemplate()->parseCurrentBlock();
56 
57  // syntax style
58  $DIC->ui()->mainTemplate()->setCurrentBlock("SyntaxStyle");
59  $DIC->ui()->mainTemplate()->setVariable(
60  "LOCATION_SYNTAX_STYLESHEET",
62  );
63  $DIC->ui()->mainTemplate()->parseCurrentBlock();
64  require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
65  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
66  $q_gui->setRenderPurpose(assQuestionGUI::RENDER_PURPOSE_PREVIEW);
67  $q_gui->setQuestionTabs();
68  $q_gui->outAdditionalOutput();
69  $q_gui->object->setObjId($this->getTestObj()->getId());
70  $question = &$q_gui->object;
71  $DIC->ctrl()->saveParameter($this, "q_id");
72  $DIC->language()->loadLanguageModule("content");
73  $DIC->ctrl()->setReturnByClass("ilAssQuestionPageGUI", "view");
74  $DIC->ctrl()->setReturnByClass("ilObjTestGUI", "questions");
75  $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
76  $page_gui->setEditPreview(true);
77  if (strlen($DIC->ctrl()->getCmd()) == 0) {
78  $DIC->ctrl()->setCmdClass(get_class($page_gui));
79  $DIC->ctrl()->setCmd("preview");
80  }
81  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(true)));
82  $page_gui->setTemplateTargetVar("ADM_CONTENT");
83  $page_gui->setOutputMode($this->getTestObj()->evalTotalPersons() == 0 ? "edit" : 'preview');
84  $page_gui->setHeader($question->getTitle());
85  $page_gui->setPresentationTitle($question->getTitle() . ' [' . $DIC->language()->txt('question_id_short') . ': ' . $question->getId() . ']');
86 
87  $html = $DIC->ctrl()->forwardCommand($page_gui);
88  $DIC->ui()->mainTemplate()->setContent($html);
89  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
Question page GUI class.
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...
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
$html
Definition: example_001.php:87
+ 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: