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

record progress on bubble choice parent after completing its sublevel #34837

Merged
merged 4 commits into from
May 20, 2020

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented May 18, 2020

Background

Description

in order to efficiently query progress for bubble choice levels, we want to store progress on the bubble choice level, rather than only on its sublevels.

Testing story

Added a unit test to verify progress is being recorded in both places.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@davidsbailey davidsbailey marked this pull request as ready for review May 19, 2020 21:20
Copy link

@clareconstantine clareconstantine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just one question about the structure behind this!

@@ -184,9 +184,28 @@ def track_progress_for_user
level_source_id: @level_source.try(:id),
pairing_user_ids: pairing_user_ids,
)

is_sublevel = !@script_level.levels.include?(@level)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify my understanding - for bubble choice, we create a ScriptLevel for the parent level, for which @script_level.levels returns an array containing the parent level. Do the sublevels also have their own ScriptLevels?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope -- the hierarchy works like this:

  • ScriptLevel contains 1 Level (or multiple levels, if using "level swapping")
  • that Level can contain sublevels (if it is a BubbleChoice or LevelGroup)
  • sublevels do not have their own ScriptLevels, but
  • sublevels do have their own UserLevels (indexed on script + level + user)

it's not ideal... but it's better than it used to be :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That clears up my confusion. Thank you! :)

@davidsbailey davidsbailey merged commit f22820c into staging May 20, 2020
@davidsbailey davidsbailey deleted the store-bc-progress branch May 20, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants