Skip to content

Array out of bounds in virtual block adding when resuming lessons #205

@george112n

Description

@george112n

When resuming lessons, it should take the StageAt and StepAt from the database and launch the tutorial from this position.

This requires the virtual blocks of all previous tasks to be recalculated and displayed to the player.

The plugin should display the virtual blocks up to and including the last step that was completed.

E.g, if the player is 'on' Stage 2, Step 5, then the plugin should display the virtual blocks for all of the steps in Stage 1, and then up to and including Sep 4 in Stage 2.

However, currently there is a shift of 1 being applied to the stage figure, meaning that it attempts to display the virtual blocks up to Stage 1 Step 4 only.

This was discovered due to an exception being thrown, because Stage 1 in the Liverpool Tutorial only has 3 steps.

The problem lies on line 199 of Lesson.java, because the stage index being passed is in fact the index of the StageAt (or the number up to the stages completed), but it should be the 'StageAt' itself, even if not completed.

Increasing this value by 1 would solve this problem. Also clarifying the docs on the method it is calling, although the docs were already fairly clear.

Metadata

Metadata

Assignees

Labels

StudentsIssues which affect studentsbugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions