-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi question xapi #352
Merged
Merged
Multi question xapi #352
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expected fixtures record the current behavior
Test was failing locally because test4.com is a real URL that responded with a 200 when we posted events to it. Not sure why it was succeeding in CI?
Updates the event processor change to allow for the possibility that some event transformers may generate multiple events from a single event, and these events need to be carried down the processor chain.
…mation This reduces the side-effects of event transformation, which will allow us to re-use base event transformation methods when generating multiple events from a single source event. * Removes the BaseTransformerMixin.transformed_event instance variable in favor of passing an event through to base_transform() to be modified and returned. * Adds BaseTransformerMixin.get_object() so that caliper events don't need to reference self.transformed_event when updating the object data. * Adds BaseTransformerMixin.get_extensions() so that caliper events can don't have to hack in their transformerVersion during BaseTransformerMixin.transform()
Single-question problem_check events still only produce one xAPI event. Changes to the top-level multi-question problem_check event data: * object.type changed from Activity to GroupActivity * object.id shows the base problem usage_key * object.definition.interaction_type is "other" New events emitted for each child problem are identical the top-level event, except for: * object.type is Activity * object.id shows the base problem usage_key including the child usage string * object.definition.interaction_type is determined by the child problem response_type * result.score is omitted -- only relevant to the parent problem * result.response is provided, pulled from the child question submission * result.success is provided, pulled from the child question submission Related fixes to all problem_check events: * object.definition.name now shows the problem display_name * object.id now uses shows the problem usage_key * result.score max and raw are now always provided if present in the source event (bug fix)
* fixes "AttributeError: 'list' object has no attribute 'to_json'" during event processing for one-to-many problem_check events * adds test for ^ * reverts unneeded change to test_caliper to reinstate 100% test coverage
* stops mocking uuid5 during tests uuid5 generates the same UUID when provided with the same namespace + name, and so we can rely on this remaining the same in the expected fixture files. * updates test data to use the actual uuid5s generated for the given input events.
* pulls event ID generation into get_event_id(), taking care not to modify how parent event IDs are generated. * overrides get_event_id() for child events by using the child_id as part of the UUID namespace_key. * updates tests to check that child events and their parent event use different event IDs, and the affected problem_check multiple-question test data
8 tasks
Ian2012
approved these changes
Sep 25, 2023
@ziafazal last chance if you want to review this beast of a PR. :) |
@bmtcril tested locally LGTM. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is continuing on the work @pomegranited did in #325 . More context is there, this is mostly just a rebase.
Description:
Updates the base event processor and tests to support transforming a single event into multiple events, and
modifies the server-side problem_check xAPI event transformer to transform multi-problem submissions into:
Resolves #219
JIRA: FAL-3430 (OpenCraft internal link)
Testing instructions:
This change should be covered by tests, but to test it manually:
Author concerns: