-
Notifications
You must be signed in to change notification settings - Fork 31
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
New: Migration Scripts (fixes #217) #218
base: master
Are you sure you want to change the base?
Conversation
|
||
mutateContent('adapt-contrib-slider - add slider._correctAnswer', async () => { | ||
sliders.forEach(slider => { | ||
const newValue = slider._correctAnswer?.toString() || ''; |
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.
This looks to be an explicit conversion to the string data type. I assume it went from number to string at some point?
You can make this clearer to read by doing the type conversion at the end of the evaluation.
const newValue = slider._correctAnswer?.toString() || ''; | |
const newValue = String(slider._correctAnswer ?? ''); |
|
||
updatePlugin('adapt-contrib-slider - update to v2.1.0', { name: 'adapt-contrib-slider', version: '2.1.0', framework: '>=2.0.0' }); | ||
|
||
testSuccessWhere('non/configured slider component with empty course', { |
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.
The description here doesn't make sense. The migration script does not modify or rely on the course object.
|
||
mutateContent('adapt-contrib-slider - remove slider._feedback._partlyCorrect', async () => { | ||
sliders.forEach(slider => { | ||
delete slider._feedback._partlyCorrect; |
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.
A test with no _feedback
object will fail.
{ _id: 'c-115', _component: 'slider' },
New
Testing
Test using this branch of the Adapt Framework which includes the scripts that handle the migration.
adaptlearning/adapt_framework#3633