Skip to content
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 9 commits into from
Sep 26, 2023
Merged

Multi question xapi #352

merged 9 commits into from
Sep 26, 2023

Commits on Sep 25, 2023

  1. test: adds tests for problem_check event with multiple questions

    Expected fixtures record the current behavior
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    4057228 View commit details
    Browse the repository at this point in the history
  2. fix: mocked test4.com host

    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?
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    2f71c4a View commit details
    Browse the repository at this point in the history
  3. feat: allow processor chains to handle multiple events

    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.
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    80c091b View commit details
    Browse the repository at this point in the history
  4. refactor: applies functional programming principles to event transfor…

    …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()
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    a1afe16 View commit details
    Browse the repository at this point in the history
  5. feat: multi-question problem_check events produce multiple xAPI events

    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)
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    60e781d View commit details
    Browse the repository at this point in the history
  6. fix: XApiProcessor.transform_event needs to handle lists of events

    * 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
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    2f19e5a View commit details
    Browse the repository at this point in the history
  7. test: ensure that xapi event UUIDs remain unchanged.

    * 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.
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    e411c58 View commit details
    Browse the repository at this point in the history
  8. fix: child events must use unique event IDs

    * 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
    pomegranited authored and bmtcril committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    b42f4be View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    53d1a4a View commit details
    Browse the repository at this point in the history