ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.exPageContentQuestions.php
Go to the documentation of this file.
1 <?php
2 
15 {
20 
24  public function __construct()
25  {
26  global $DIC; /* @var ILIAS\DI\Container $DIC */
27 
28  $this->qstResourcesCollector = $DIC->question()->getQuestionResourcesCollector();
29  }
30 
36  public function getQuestionOfflinePresentations($a_no_interaction, $a_mode)
37  {
38  global $DIC; /* @var ILIAS\DI\Container $DIC */
39 
40  $questionReferences = array(); // initialise with ids of all questions embedded in the content page
41 
42  $qstOfflinePresentations = array();
43 
44  foreach ($questionReferences as $questionRef) {
50  $questionId = ilInternalLink::_extractObjIdOfTarget($questionRef);
51 
57  $image_path = null;
58  if ($a_mode == "offline") {
59  if ($anyObjParentType == "sahs") {
60  $image_path = "./objects/";
61  }
62  if ($anyObjParentType == "lm") {
63  $image_path = "./assessment/0/" . $questionId . "/images/";
64  }
65  }
66 
73  $questionInstance = $DIC->question()->getOfflineExportableQuestionInstance(
74  $questionId,
75  $image_path,
76  $a_mode
77  );
78 
83  $qstOfflinePresentationExporter = $DIC->question()->getQuestionOfflinePresentationExporter(
84  $questionInstance
85  );
86 
95  $qstOfflinePresentations[$questionId] = $qstOfflinePresentationExporter->exportQuestion(
96  $this->qstResourcesCollector,
97  $a_no_interaction
98  );
99  }
100 
101  return $qstOfflinePresentations;
102  }
103 }
__construct()
exPageContentQuestions constructor.
For components that needs to integrate the assessment question service in the way, that questions act as independent assessment items client side, the former implementation is mostly kept but has been moved to the assessment question service.
getQuestionOfflinePresentations($a_no_interaction, $a_mode)
global $DIC
Definition: feed.php:28