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

redirect course and script overview pages to add the teacher's most recent section_id #24546

Merged
merged 5 commits into from Aug 30, 2018

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Aug 29, 2018

Background

line item from spec: https://docs.google.com/document/d/17X2bEVK4YO4gymmVEzAnDYCYTjE5xHQTlDSAZbEprTo/edit#bookmark=id.ljdodx5zi2wn

The idea is to always show a selected section on the course and script overview pages when possible.

Description

If a request from a teacher with sections is made for a course or script overview page without a section_id in the url, perform a redirect which keeps the same url path but replaces the query string with a ?section_id= referring to the id of their most recently created section.

Caveats

In theory if we had other url params, this solution would not be great because we would clobber them. However the only other url params I am aware of on these paths at this time are the ones developers use to enable/disable experiments, so I'm inclined to say YAGNI and deal with preserving the query strong if and when it becomes necessary. If there's a simple way to do this that I'm missing, I don't mind adding it now though.

There are other places, such as script levels, where a teacher might have other url params, such as when they are viewing the level as one of their students. We do not plan to add a default section id in that situation, so we don't have to worry about this solution being generalized to that case.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

🎉 Great, simple solution.

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