Skip to content

Lockable stage numbering#9708

Merged
Bjvanminnen merged 1 commit into
stagingfrom
lockableStageNumbering
Jul 27, 2016
Merged

Lockable stage numbering#9708
Bjvanminnen merged 1 commit into
stagingfrom
lockableStageNumbering

Conversation

@Bjvanminnen

Copy link
Copy Markdown
Contributor

When we have lockable stages, they will eventually be hidden depending on certain criteria. We don't want the numbering of subsequent stages to change depending on whether the lockable stage is currently viewable or not.

The solution is that lockable stages are not numbered, and don't count towards the numbering of other stages.
image
For example, in the above screen shot, the third stage is lockable. As such it is not numbered, and the fourth stage is called Stage 3.

@joshlory

Copy link
Copy Markdown
Contributor

This seems like it could get confusing. When the stage is unlocked, it still has no number?

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

Yes, because stages will be unlocked for a short period of time, and then later locked again. We want teachers to be able to be able to refer to things like Stage N and be able to know exactly what it is. i.e. In the screenshot above, we always want Stage 3 to be the Free Response stage, regardless of whether or not the rich long assessment stage is currently hidden or not.

@Bjvanminnen Bjvanminnen force-pushed the lockableStageNumbering branch from b9e1706 to 2583b8a Compare July 26, 2016 22:21
@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

This should now be ready for review :)

I18n.t('stage_number', number: position) + ': ' + I18n.t("data.script.name.#{script.name}.#{name}")
# Because lockable stages aren't numbered, our stage number is actually our
# position, minus the number of lockable stages preceeding us
stage_number = position - script.stages.to_a[0, position].count(&:lockable)

@joshlory joshlory Jul 27, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Super small nit: Could cache total_lockable, otherwise we'll be counting lockable n times where n is the number of stages in the script. But it's on the cached array, so not a big issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

luckily, n is also always quite small (<100)

I'm not sure we can actually cache easily here, as we need more than just total_lockable - we need how many are lockable before us. If stages 2 and 4 are lockable, this means the number is 1 for stage 3, but 2 for stage 5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah right, that makes sense.

@joshlory

Copy link
Copy Markdown
Contributor

This LGTM per the spec, but I do wonder about the added complexity in numbering. We have a slightly different version of removing stage numbers in course_progress_row.jsx (hides the number without renumbering subsequent stages).

On the flip side, the localized title should only ever be a user-facing string, so maybe I'm overstating the issue. Will these stages eventually have a different style to denote that they're "temporary"?

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

tagging @poorvasingal regarding josh's concerns about spec and question about whether we might style these stages differently for students (I kind of like this idea)

@poorvasingal

Copy link
Copy Markdown
Contributor

To clarify, they are never seen as "temporary" to a given student. A given student either * always * sees the stage (because they are in a Code Studio section w/ a verified teacher) or they * never * see the stage (because they aren't in such a section). We didn't want to number these stages because it would end up messing with the existing numbering, which is a problem since those stage #s are referred to in the curriculum. If a stage is locked (but visible to the given student), then you'll just see the lock symbol on the level progression bubbles.

Also tagging @tanyaparker in case she has thoughts on styling these stages. I can see us wanting to give these stages a special color or something.

@tanyaparker

tanyaparker commented Jul 27, 2016

Copy link
Copy Markdown
Contributor

Simplest would be to highlight the whole stage box similar to the bubbles and also reminiscent of PLC focus areas?

image

Or something like this, but starts looking meant for teachers.

image

image

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

You're right that a given student will either always see this or never see this (though sometimes they will see it as locked). I think I'd been forgetting that. I would advocate that we leave as is for now, but continue to consider whether we want to style these differently in the future.

@poorvasingal

Copy link
Copy Markdown
Contributor

@tanyaparker - Agreed that the highlighting looks like you're trying to get the student to focus on that area, which would be frustrating esp. when the stage is locked. I tried playing around with changing the background color and that has basically the same effect.

@Bjvanminnen - I'd advocate for leaving as is right now too.

@Bjvanminnen Bjvanminnen merged commit 9c1d6b2 into staging Jul 27, 2016
@Bjvanminnen Bjvanminnen deleted the lockableStageNumbering branch July 27, 2016 18:52
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.

4 participants