ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
exPageContentQuestions Class Reference

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. More...

+ Collaboration diagram for exPageContentQuestions:

Public Member Functions

 __construct ()
 exPageContentQuestions constructor. More...
 
 getQuestionOfflinePresentations ($a_no_interaction, $a_mode)
 

Protected Attributes

 $qstResourcesCollector
 

Detailed Description

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.

Future visions tries to unify the assessment and the offline presentation like known from the learning module, but up to now there is no technical concept available. Existing visions for feature requests to support offline and/or cached test scenarios will address the requirement of a presentation implementation that acts similar to the presentation in the learning module, but connected to a qualified ajax backend for solution submissions.

Definition at line 14 of file class.exPageContentQuestions.php.

Constructor & Destructor Documentation

◆ __construct()

exPageContentQuestions::__construct ( )

exPageContentQuestions constructor.

Definition at line 24 of file class.exPageContentQuestions.php.

References $DIC.

25  {
26  global $DIC; /* @var ILIAS\DI\Container $DIC */
27 
28  $this->qstResourcesCollector = $DIC->question()->getQuestionResourcesCollector();
29  }
$DIC
Definition: xapitoken.php:46

Member Function Documentation

◆ getQuestionOfflinePresentations()

exPageContentQuestions::getQuestionOfflinePresentations (   $a_no_interaction,
  $a_mode 
)
Parameters
$a_no_interaction// enables a kind of preview mode
$a_mode// currently required by content pages
Returns
array an array with a htmloffline presentation per question

the current integration of questions in e.g. the learning module stores question references containing the instId and the qstId

the consumer of offline question presentation currently needs to control the path for question resources like media files or mobs

the actual rendering of the question depends on an ilAsqQuestionInstance that got correctly configured. therefore the question instance is build by a corresponding ilAsqFactory method

the exporter for the question offline presentation can be requested from the ilAsqFactory

the ilAsqQuestionOfflinePresentationExporter returns a renderable component.

an instance of ilAsqQuestionResourcesCollector needs to be injected that collects all kind resources the consumer needs to organize for the offline presentation. (js/css files, media files, mobs)

Definition at line 36 of file class.exPageContentQuestions.php.

References $DIC, and ilInternalLink\_extractObjIdOfTarget().

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  }
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Field Documentation

◆ $qstResourcesCollector

exPageContentQuestions::$qstResourcesCollector
protected

Definition at line 19 of file class.exPageContentQuestions.php.


The documentation for this class was generated from the following file: