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

replaced named level with progression when serializing script dsl #41714

Merged
merged 7 commits into from Jul 26, 2021

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Jul 23, 2021

Starts https://codedotorg.atlassian.net/browse/PLAT-621.

Background

What are named levels and progressions?

  1. By default, levels appear in a lesson like this:
    Screen Shot 2021-07-23 at 11 47 17 AM

  2. If a progression is applied to multiple consecutive levels, it looks like this:

  • level 'Intro to Debugging and Common Problems_2018', progression: 'Intro to Debugging and Common Problems'
    level 'CSPU5_predict_applab_onEventWithWrongID_2018', progression: 'Intro to Debugging and Common Problems'
    level 'CSPU5_U3L13 - Debugging IDs case sensitive_2018', progression: 'Intro to Debugging and Common Problems'
    level 'CSPU5_Debugging predict unexpected behavior - two onEvents to one_2018', progression: 'Intro to Debugging and Common Problems'
    level 'CSPU5_U3L13 - Debugging 3_2018', progression: 'Intro to Debugging and Common Problems'
  • Screen Shot 2021-07-23 at 11 57 41 AM
  1. If a progression is applied to exactly one level, it appears on a line by itself along with the progression name:
  1. When a level is "named", it appears on a line by itself along with a custom display name, just like a progression containing only one level. however, in this case the display name is determined by the display_name property on the level:
  1. If a named level has no display name, the level name is shown instead.

  2. If a named level also has a progression, the progression takes precedence:

  • Screen Shot 2021-07-23 at 11 54 08 AM
  • lesson 'Building an App: Color Sleuth', display_name: 'Building an App: Color Sleuth', has_lesson_plan: true
    level 'CSP U5L10 SFLP', named: true
    level 'Color Sleuth - Planning the App_2018', progression: 'Color Sleuth - Planning the App', named: true

Why do we want to get rid of named levels?

The new script editor does not support named levels. named levels are also redundant functionality, because the same goal can be accomplished by adding a progression. adding a progression is superior because it does not require finding the level and adding a display name to it, rather the name can be added without leaving the lesson editor.

Description

The plan is as follows:

  • (this PR) when serializing script DSL, convert named syntax to progression syntax
  • run Script.all.each(&:write_script_dsl)on levelbuilder, which will remove named syntax from all .script files
  • remove code for parsing named syntax when seeding scripts from script DSL

Testing story

  • new unit tests cover the new behavior
  • run step 2 locally, then spot-check a few different scripts with different combinations of named and progression settings to confirm there is no visible change to end users

@davidsbailey davidsbailey changed the title Eliminate named level usages replaced named level syntax with progression syntax when serializing script dsl Jul 23, 2021
@davidsbailey davidsbailey changed the title replaced named level syntax with progression syntax when serializing script dsl replaced named level with progression when serializing script dsl Jul 23, 2021
@davidsbailey davidsbailey requested a review from a team July 26, 2021 16:59
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with these properties of levels, but the explanation makes sense and the plan for gradual conversion seems reasonable!

@davidsbailey davidsbailey merged commit b96eb21 into staging Jul 26, 2021
@davidsbailey davidsbailey deleted the eliminate-named-level-usages branch July 26, 2021 22:15
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