ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
When a component consumes the assessment question service for purposes of authoring and managing questions like the current question pool object, it is neccessary to handle the following use cases. More...
Public Member Functions | |
executeCommand () | |
The question creation and editing is handled by the the ilAsqQuestionAuthoring interface. More... | |
showQuestions () | |
For question listings the ilAsqQuestionFactory provides a factory method to retrieve an array of associative question data arrays. More... | |
importQuestions () | |
When a component provides import functionality for assessment questions, it needs to make use of the ILIAS QTI service to get any qti xml parsed to an QTI object graph provided by the QTI service. More... | |
exportQuestions () | |
When a component provides export functionality for assessment questions, it needs the ilAsqQuestion interface method toQtiXML to retrieve an qti item xml string. More... | |
deleteQuestion () | |
For the deletion of questions ilAsqQuestion provides the interface method deleteQuestion. More... | |
When a component consumes the assessment question service for purposes of authoring and managing questions like the current question pool object, it is neccessary to handle the following use cases.
Definition at line 8 of file class.exObjQuestionPoolGUI.php.
exObjQuestionPoolGUI::deleteQuestion | ( | ) |
For the deletion of questions ilAsqQuestion provides the interface method deleteQuestion.
The ilAsqFactory is to be used to get the ilAsqQuestion instance for any given questionId. A simple call to deleteQuestion deletes the question and all its data.
use the ilAsqFactory to get an ilAsqQuestion instance that supports the deletion process
Definition at line 138 of file class.exObjQuestionPoolGUI.php.
References $DIC.
exObjQuestionPoolGUI::executeCommand | ( | ) |
The question creation and editing is handled by the the ilAsqQuestionAuthoring interface.
It is relevant for the request flow using the ILIAS control structure. This interface will be implemented from the current question GUI classes in the future and provides the executeCommand method that internally performs the different commands.
To integrate the workflow of authoring questions to a consumer, the consumer's GUI class must implement a suitable forward case in its own executeCommand method.
Since the consumer MUST not know about any concrete question type's ilAsqQuestionAuthoring implementation a dynamic switch-case expression is neccessary. The ilAsqService class provides such an expression with a corresponding method. It returns the lowercase class name for the corresponding question type authoring class or the interface name when the current next class in the control flow does not relate to any question type authoring class. An instance of the service class can be requested using $DIC->question()->service().
Definition at line 26 of file class.exObjQuestionPoolGUI.php.
References $DIC.
exObjQuestionPoolGUI::exportQuestions | ( | ) |
When a component provides export functionality for assessment questions, it needs the ilAsqQuestion interface method toQtiXML to retrieve an qti item xml string.
Since the QTI service does not support to fetch an QTI xml string based on an QTI object graph, the current implementation of returning the xml string itself will be kept within the toQtiXML interface method.
To export one or more assessment questions the ilAsqFactory provides factory methods to get single or multiple ilAsqQuestion instances.
get questions managed by this parent object
build QTI xml string that will be used for any kind of export
Definition at line 111 of file class.exObjQuestionPoolGUI.php.
References $DIC.
exObjQuestionPoolGUI::importQuestions | ( | ) |
When a component provides import functionality for assessment questions, it needs to make use of the ILIAS QTI service to get any qti xml parsed to an QTI object graph provided by the QTI service.
To actually import the question as an assessment question the ilAsqQuestion interface method fromQtiItem can be used. To retrieve an empty ilAsqQuestion instance, the question type of the QtiItem needs to be determined.
For the question type determination the ilAsqService class provides a corresponding method. An instance of the service class can be requested using $DIC->question()->service().
parse any qti import xml using the QTI Service and retrieve an array containing ilQTIItem instances
Definition at line 80 of file class.exObjQuestionPoolGUI.php.
References $DIC.
exObjQuestionPoolGUI::showQuestions | ( | ) |
For question listings the ilAsqQuestionFactory provides a factory method to retrieve an array of associative question data arrays.
This structure can be simply used as data structure for any ilTable2 implementation.
initialise any ilTable2GUI with this data array render initialised ilTable2GUI
Definition at line 50 of file class.exObjQuestionPoolGUI.php.
References $DIC.