ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAssQuestionPageCommandForwarder.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14 {
18  protected $testObj;
19 
23  public function getTestObj()
24  {
25  return $this->testObj;
26  }
27 
31  public function setTestObj($testObj)
32  {
33  $this->testObj = $testObj;
34  }
35 
36  public function forward()
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  }
90 }
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