When an element is dragged into a drop zone an xAPI 'interacted' event is triggered before the state has been updated, which means the new/current state is not provided by a call to getXAPIData() in handlers listening for xAPI events. This behaviour also seems to be at odds with the way other content types work.
Moving the line this.trigger('addedToZone'); from the start of Draggable.prototype.addToZone to the end fixes this, ie:
Draggable.prototype.addToZone = function (droppable) {
if (this.insideDropzone !== null) {
this.insideDropzone.removeDraggable();
}
this.toggleDroppedFeedback(true);
this.insideDropzone = droppable;
this.setShortFormat();
this.trigger('addedToZone');
};
When an element is dragged into a drop zone an xAPI 'interacted' event is triggered before the state has been updated, which means the new/current state is not provided by a call to
getXAPIData()
in handlers listening for xAPI events. This behaviour also seems to be at odds with the way other content types work.Moving the line
this.trigger('addedToZone');
from the start ofDraggable.prototype.addToZone
to the end fixes this, ie: