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

Restore "use script id to find teacher feedback script level" #38860

Merged

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Feb 2, 2021

Reverts #38855, restoring #38729.

#38729 caused honeybadger errors when trying to view feedback on bubble choice sublevels. the problem is that the code in that PR assumed that the teacher feedback level would have its own script level. However, this is not true in the case of bubble choice levels, where only the bubble choice (parent) level itself has a script level.

The solution here is to first do the cheaper search for the level within the script. When that fails, do a more expensive search for the level within each bubble choice level in the script.

@davidsbailey davidsbailey force-pushed the revert-38855-revert-38729-use-feedback-script-id branch from f9112da to 56732d2 Compare February 11, 2021 23:11
Copy link
Contributor

@dmcavoy dmcavoy left a comment

Choose a reason for hiding this comment

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

The updates makes sense to me based on the issue you outlined. Thanks Dave!

# will show up in script.script_levels.
script = create :script
lesson_group = create :lesson_group, script: script
lesson = create :lesson, lesson_group: lesson_group, script: script
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to address as part of this PR, but I'm curious if there's anything we can do in factories to short cut knowing and creating each rung?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes - when creating a script level, the rung that is missing is lesson group. there should be a way to make the lesson factory create a lesson group, the same way the script level factory creates a lesson:

lesson do |script_level|
create(:lesson, script: script_level.script)
end

I tried this, but it didn't work using similar syntax.

@davidsbailey davidsbailey merged commit c0d5118 into staging Feb 15, 2021
@davidsbailey davidsbailey deleted the revert-38855-revert-38729-use-feedback-script-id branch February 15, 2021 17:57
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

3 participants