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
Restore "use script id to find teacher feedback script level" #38860
Conversation
f9112da
to
56732d2
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
code-dot-org/dashboard/test/factories/factories.rb
Lines 725 to 727 in 62b10f0
lesson do |script_level| | |
create(:lesson, script: script_level.script) | |
end |
I tried this, but it didn't work using similar syntax.
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.