-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Call storeUserAnswer on item change (fixes #493) #494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oliverfoster if we're firing this.storeUserAnswer on setActiveItem should we also we remove it from checkCompletionStatus as it's currently firing twice when an child's _isVisited changes?
Hmm, probably not. One could change the active item without calling adapt-contrib-core/js/models/itemModel.js Lines 3 to 23 in 301890e
It's a shame it's called twice. Perhaps This is needed because checkCompletionStatus only saves before completion, not after it. With presentation components it's possible to change the active item even once the component is complete. Or maybe it should just save whenever the children change? Detached from completion and a specific change api? |
I'm going to move this to narrative for the time being I think. |
@oliverfoster good points I'd not thought of updating through the item, it feels like having it in core is sensible as it can be utilised by other components without duplicating. Having it on children change does seem like a good option as it seperates it from both completion and setActiveItem, listen for change: _isActive maybe? |
_isActive and _isVisited seem to be quite closely linked, _isVisited is used for checkCompletionStatus and _isActive is used for selecting the item, with narrative something can't be _isVisited unless it was once _isActive but the code allows _isVisited and _isActive to be set independently of each other, _isVisited is used to save state here, _isActive is used to keep the active item. I've just made it save when any property changes to keep it easy. |
🎉 This PR is included in version 6.45.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
* Fix: Keep active item position on save/restore (fixes #295) * Fix: storeUserAnswer on setActiveItem Moved from adaptlearning/adapt-contrib-core#494 * Revert * FW bump for core dependency --------- Co-authored-by: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com>
fixes #493
Fix