Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

New: Migration Scripts (fixes #217) #218

wants to merge 4 commits into from

Conversation

joe-replin
Copy link
Contributor

New

Testing

Test using this branch of the Adapt Framework which includes the scripts that handle the migration.
adaptlearning/adapt_framework#3633

@joe-replin joe-replin self-assigned this Feb 13, 2025

mutateContent('adapt-contrib-slider - add slider._correctAnswer', async () => {
sliders.forEach(slider => {
const newValue = slider._correctAnswer?.toString() || '';
Copy link
Member

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.

Suggested change
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', {
Copy link
Member

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;
Copy link
Member

@oliverfoster oliverfoster Mar 10, 2025

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' },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Reviewing
Development

Successfully merging this pull request may close these issues.

Add migration scripts to the repo
3 participants