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

not compatible with Framework 5.5 #23

Open
No-Smoke opened this issue May 28, 2020 · 4 comments
Open

not compatible with Framework 5.5 #23

No-Smoke opened this issue May 28, 2020 · 4 comments

Comments

@No-Smoke
Copy link

Hello, this plug-in does not work with latest Adapt framework 5.5.
It would be great if you could update.

@oliverfoster
Copy link

oliverfoster commented Jun 4, 2020

This is my fault, apologies.

PR to fix in framework: adaptlearning/adapt_framework#2788
!!Update above PR has now been released with v5.5.1

This component also needs updating. This line is deprecated https://github.com/ExultCorp/adapt-contrib-flipcard/blob/master/js/adapt-contrib-flipcard.js#L156

image

You need to register a model such as:

/*
 * adapt-contrib-flipcard
 * License - https://github.com/ExultCorp/adapt-contrib-flipcard/blob/master/LICENSE
 * Maintainers - Himanshu Rajotia <[email protected]>
 */
define([
    'core/js/models/componentModel', // add this
    'core/js/views/componentView', // change these to use proper paths
    'core/js/adapt'
], function(ComponentModel, ComponentView, Adapt) {

     // missing code

    Adapt.register('flipcard', {
      model: ComponentModel.extend({}), // register the model, it should be an extension of ComponentModel, an empty extension is fine
      view: Flipcard
    });

    return Flipcard;

});

This way, flipcard has a model and view for rendering:

image

Rather than relying on the ComponentModel which I'd forgotten to register maybe I think because we stopped registering just views a while ago:
image

All core components now register both models and views. It keeps a nice separation of behaviour. Accordion, MCQ.

Reference to original comment: #18 (comment)

@Amn5600
Copy link

Amn5600 commented Jun 8, 2020

This is my fault, apologies.

PR to fix in framework: adaptlearning/adapt_framework#2788

This component also needs updating. This line is deprecated https://github.com/ExultCorp/adapt-contrib-flipcard/blob/master/js/adapt-contrib-flipcard.js#L156

image

You need to register a model such as:

/*
 * adapt-contrib-flipcard
 * License - https://github.com/ExultCorp/adapt-contrib-flipcard/blob/master/LICENSE
 * Maintainers - Himanshu Rajotia <[email protected]>
 */
define([
    'core/js/models/componentModel', // add this
    'core/js/views/componentView', // change these to use proper paths
    'core/js/adapt'
], function(ComponentModel, ComponentView, Adapt) {

     // missing code

    Adapt.register('flipcard', {
      model: ComponentModel.extend({}), // register the model, it should be an extension of ComponentModel, an empty extension is fine
      view: Flipcard
    });

    return Flipcard;

});

This way, flipcard has a model and view for rendering:

image

Rather than relying on the ComponentModel which I'd forgotten to register maybe I think because we stopped registering just views a while ago:
image

All core components now register both models and views. It keeps a nice separation of behaviour. Accordion, MCQ.

Reference to original comment: #18 (comment)

Hi oliver,
for me " 'core/js/models/itemsComponentModel'" line works. kindly confirm if it is wrong.

@olivermartinfoster
Copy link

olivermartinfoster commented Jun 8, 2020

It works because ItemsComponentModel is an extension of ComponentModel . Flipper does not currently use any behaviour specifically provided by ItemsComponentModel.

@Amn5600
Copy link

Amn5600 commented Jun 8, 2020

Thanks, Oliver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants