ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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}
An exception for terminatinating execution or to throw for unit testing.
For components that needs to integrate the assessment question service in the way,...
getQuestionOfflinePresentations($a_no_interaction, $a_mode)
__construct()
exPageContentQuestions constructor.
$DIC
Definition: xapitoken.php:46