feat(TimedSteps): New type of step containing a series of timed components#2198
feat(TimedSteps): New type of step containing a series of timed components#2198Aaron-Detre wants to merge 12 commits intodevelopfrom
Conversation
hirokiterashima
left a comment
There was a problem hiding this comment.
Nice job! 👍 The functionality mostly seems to work as you described. I agree that the having the "proceed" button next to the timer makes it clearer for the user.
I noticed some minor issues (below) and code improvement suggestions (inline).
Issues, improvements
- See code improvement suggestions inline
- In preview, I finish the step and see the "You have completed this step” message. I then go to previous step and come back, and it lets me work on the first component again.
- Countdown glitch. Sometimes, due to some combination of letting the component timer finish and clicking on "proceed" for others, the timer seems to decrease erratically, like in 2-second decrements. See this video:
timer_glitch.mov
Questions
- Should we default to 60(?) seconds for each timed component in the authoring tool? We should require a non-null number for the timeLimit value to simplify code. Having a default can help ensure that.
- Right now, the timeLimit input is always shown for all components in the step in the. authoring tool. Should we only show it when the component is being edited? In this scenario, it would be good to show the time limit value for each component.
| if (this.timedStep) { | ||
| return !this.timedStepCompleted; | ||
| } else { | ||
| return false; | ||
| } |
| protected nodeStatus: any; | ||
| protected nodeStatuses: any; | ||
| protected prevId: string; | ||
| @Input() private timedStep: boolean; |
There was a problem hiding this comment.
Instead of making timedStep an input to this component, can we set this in updateModel()?
| @Input() private timedStep: boolean; | |
| private timedStep: boolean; |
| <ng-template #defaultVLETemplate> | ||
| @if (layoutState === 'node') { | ||
| <step-tools class="control-bg-bg mat-elevation-z1" /> | ||
| <step-tools class="control-bg-bg mat-elevation-z1" [timedStep]="isCurrentNodeTimed()" /> |
There was a problem hiding this comment.
Calculate timedStep boolean in StepToolsComponent.updateModel()? Remove isCurrentNodeTimed() function?
| <step-tools class="control-bg-bg mat-elevation-z1" [timedStep]="isCurrentNodeTimed()" /> | |
| <step-tools class="control-bg-bg mat-elevation-z1" /> |
| const node = this.projectService.getNodeById(this.node.id); | ||
| return node.timed !== null && node.timed; |
There was a problem hiding this comment.
Simplify?
| const node = this.projectService.getNodeById(this.node.id); | |
| return node.timed !== null && node.timed; | |
| return this.projectService.getNodeById(this.node.id).timed; |
| export class TimedNodeComponent extends NodeComponent { | ||
| private componentTimers: number[]; | ||
| private currentComponentIndex = 0; | ||
| private currentInterval: any; |
There was a problem hiding this comment.
| private currentInterval: any; | |
| private currentInterval: number; |
| return this.components.at(this.currentComponentIndex).id; | ||
| } | ||
|
|
||
| private getComponentSubmitArgs(componentId: string) { |
There was a problem hiding this comment.
| private getComponentSubmitArgs(componentId: string) { | |
| private getComponentSubmitArgs(componentId: string): any { |
| } | ||
| } | ||
|
|
||
| private saveUnsavedWork() { |
There was a problem hiding this comment.
| private saveUnsavedWork() { | |
| private saveUnsavedWork(): void { |
| } | ||
|
|
||
| private saveUnsavedWork() { | ||
| if (!this.isPreview()) { |
There was a problem hiding this comment.
Check !isPreview() before calling this function?
| this.components.forEach((component, index) => { | ||
| this.componentToVisible[component.id] = index === this.currentComponentIndex; | ||
| }); |
There was a problem hiding this comment.
Can we call this.hideComponents() here?
| this.components.forEach((component, index) => { | |
| this.componentToVisible[component.id] = index === this.currentComponentIndex; | |
| }); | |
| this.components.forEach((component, index) => { | |
| this.componentToVisible[component.id] = index === this.currentComponentIndex; | |
| }); |
| } | ||
|
|
||
| protected updateComponentVisibility(): void { | ||
| return; |
There was a problem hiding this comment.
It'd be good to have a comment about why we're overloading it with an empty body.
| return; | |
| // do nothing because ... |
Changes
Test
Other