ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
class.exPageContentQuestions.php
Go to the documentation of this file.
1
<?php
2
14
class
exPageContentQuestions
15
{
19
protected
$qstResourcesCollector
;
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
}
exPageContentQuestions
For components that needs to integrate the assessment question service in the way,...
Definition:
class.exPageContentQuestions.php:15
exPageContentQuestions\$qstResourcesCollector
$qstResourcesCollector
Definition:
class.exPageContentQuestions.php:19
exPageContentQuestions\getQuestionOfflinePresentations
getQuestionOfflinePresentations($a_no_interaction, $a_mode)
Definition:
class.exPageContentQuestions.php:36
exPageContentQuestions\__construct
__construct()
exPageContentQuestions constructor.
Definition:
class.exPageContentQuestions.php:24
ilInternalLink\_extractObjIdOfTarget
static _extractObjIdOfTarget(string $a_target)
Extract object id out of target.
Definition:
class.ilInternalLink.php:332
$DIC
global $DIC
Definition:
feed.php:28
Services
AssessmentQuestion
examples
class.exPageContentQuestions.php
Generated on Sun Nov 2 2025 22:01:28 for ILIAS by
1.9.4 (using
Doxyfile
)