Lockable stage numbering#9708
Conversation
|
This seems like it could get confusing. When the stage is unlocked, it still has no number? |
|
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. |
b9e1706 to
2583b8a
Compare
|
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ah right, that makes sense.
|
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"? |
|
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) |
|
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. |
|
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. |
|
@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. |



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.

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.