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

All levels unlocked when no course instance #5027

Closed

Conversation

chethana-sastry
Copy link
Contributor

@chethana-sastry chethana-sastry commented Nov 7, 2018

As a quick fix, we are locking and hiding all levels when courseInstance-Id is not available. As an improvement, created a task to tackle in future to query for courseInstanceId if it is missing and direct the user to the right course instance in this scenario -
Redirect user to right course Instance when courseInstanceId is removed from query variable in the url

Now we are locking and hiding all levels before the code for unlocking the right levels is executed. So, the flashing of unlocked levels before the map gets loaded completely does not happen anymore!

Copy link
Contributor

@differentmatt differentmatt left a comment

Choose a reason for hiding this comment

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

Will this @annotateLevels call break anything since we're initializing level.locked sooner than previously?
https://github.com/codecombat/codecombat/blob/0c98ddb/app/views/play/CampaignView.coffee#L700

It doesn't seem like we should initialize all the levels to locked and hidden for every render, especially if @courseStats is loaded since that will make determineNextLevel overwrite this initial data. Let's separate one-time initializations from frequent render calls.

Moving classroom-specific level initialization elsewhere would also prevent us from adding more complexity to annotateLevels. As written, these changes are mixing classroom and home logic within the main loop of annotateLevels. In general, we should try to keep classroom and home logic as isolated as possible.

app/views/play/CampaignView.coffee Outdated Show resolved Hide resolved
…https://github.com/codecombat/codecombat into all-levels-unlocked-when-no-courseInstanceId"

This reverts commit 0c98ddb, reversing
changes made to 71e3895.
@nwinter nwinter closed this Dec 10, 2020
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