adaptlearning / adapt-contrib-spoor

A basic scorm tracking plugin for Adapt
GNU General Public License v3.0
14 stars 42 forks source link

Make trackingIdType default to component #282

Open chris-steele opened 1 year ago

chris-steele commented 1 year ago

Subject of the enhancement

When tracking IDs are attached to blocks (as is the current default) data restoration can result in incorrect completion information if the user has flipped the layout of two components in a block (i.e. by modifying the _layout property).

Propose that _trackingIdType defaults to component in StatefulSession and the documentation is amended to warn users about the potential of the problem described in this issue if the value is changed.

N.B. the pattern of this issue is general; for example, if article is used then any change in the order of descendant models (blocks and components) will result in incorrect data restoration and so on.

Your environment

Steps to reproduce

Launch a course with tracking enabled (LMS or cookie), select a block with two components and complete only one of the components. Close the course, then update the course by changing the _layout properties of the two components in the selected block; flipping them left/right. Relaunch the course and note that the component previously completed is now incomplete.

Expected behaviour

Completion data should be restored correctly.

Actual behaviour

Completion data was not restored correctly!