ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
When a component wants to integrate the assessment question service to present questions to users in an assessment scenario, the following use cases needs to be handled by the component. More...
Public Member Functions | |
showQuestion () | |
When presenting an assessment question to a user, the ilAsqQuestionPresentation provides the interface methods to either get a renerable UI coponent for a question presentation or for a solution presentation. More... | |
submitSolution () | |
With the presentation of an assessment question, this question also gets submitted having any solution filled out by any user. More... | |
getParticipantSolution ($questionId) | |
this method returns either an initialised solution object instance, or and empty one, depending on self managed test results (handled by a future ilTestResult) More... | |
When a component wants to integrate the assessment question service to present questions to users in an assessment scenario, the following use cases needs to be handled by the component.
This kind consume of the assessment question service does not support the offline export presentation yet.
Definition at line 9 of file class.exTestPlayerGUI.php.
exTestPlayerGUI::getParticipantSolution | ( | $questionId | ) |
this method returns either an initialised solution object instance, or and empty one, depending on self managed test results (handled by a future ilTestResult)
integer | $questionId |
when the test has any test result based on an existing participant solution, the solution id needs to be looked up. an empty solution is returned otherwise.
Definition at line 173 of file class.exTestPlayerGUI.php.
References $DIC.
Referenced by showQuestion(), and submitSolution().
exTestPlayerGUI::showQuestion | ( | ) |
When presenting an assessment question to a user, the ilAsqQuestionPresentation provides the interface methods to either get a renerable UI coponent for a question presentation or for a solution presentation.
An instance implementing the ilAsqPresentation according to the given question type is provided by a factory method within ilAsqFactory.
Both methods getQuestionPresentation and getSolutionPresentation gets an instance of ilAsqSolution injected. This solution can either be an user solution or the best solution.
Additional interface methods in ilAsqQuestionPresentation return renderable UI components for the generic and specific feedbacks. These methods also need to get an ilAsqSolution instance injected.
In case of presenting the best solution the required ilAsqSolution instance can be retrieved from the ilAsqQuestion interface.
For any existing user response that is to be presented with the question the instance implementing ilAsqSolution can be requested from the ilAsqFactory using the solutionId that is to be registered within the consuming component in relation to the user's id and additional information (like e.g. test results).
Variants in usage defined by the consumer:
fetch possibly existing participant solution, an empty one is required otherwise
question presentation to be answered by the examine
feedback presentation for the given
best solution presentation to be answered by the examine
Definition at line 37 of file class.exTestPlayerGUI.php.
References $DIC, and getParticipantSolution().
exTestPlayerGUI::submitSolution | ( | ) |
With the presentation of an assessment question, this question also gets submitted having any solution filled out by any user.
With the first presentation there should be no previous user response available. The consuming component needs to request an empty ilAsqSolution instance for the given questionId.
The ilAsqSolution interface method initFromServerRequest is to be used to initialize the object instance with the user response. With the current concept the newly introduced needs to be injected to this method, but may simply passing $_POST could be an alternative. This depends on the future strategy of abstracting the http server request in ILIAS.
After having this solution saved, the consuming component needs to register the now available solutionId together with the questionId and the userId. Additionally this ilAsqSolution instance can be used with a question corresponding ilAsqResultCalculator to retrieve the information about right/wrong (used for e.g. answer status in CTM's test sequence) and reached points (used as a future ilTestResult) to be stored as any result within the consuming component.
After the first submission of any user response the consuming component needs to provide the corresponsing solutionId to request the existing ilAsqSolution instance from the ilAsqFactory for every additional submit.
The way harvesting and handling solution data in short:
fetch possibly existing participant solution, an empty one is required otherwise
let the solution object instance harvest the submission post data
get results calculator to be used to retrieve calculated reached points that can be stored in a test result storage managed by the test object
handle the calculated result in any kind
Definition at line 123 of file class.exTestPlayerGUI.php.
References $DIC, and getParticipantSolution().