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

View Model Code to Models - Create standard models #1179

Closed
oliverfoster opened this issue Jul 28, 2016 · 9 comments
Closed

View Model Code to Models - Create standard models #1179

oliverfoster opened this issue Jul 28, 2016 · 9 comments
Assignees

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Jul 28, 2016

We should create a series of core component models for standard model behaviour.

  • This will reduce the footprint for bug fixing
  • Facilitate reuse
  • Standardise common behaviour
@oliverfoster oliverfoster self-assigned this Jul 28, 2016
@oliverfoster oliverfoster changed the title View Model Code to Models View Model Code to Models - Create standard models Jul 28, 2016
@oliverfoster
Copy link
Member Author

oliverfoster commented Mar 16, 2017

we need a core model for each items, mcq and slider

the mcq one is done, but it still lives in the mcq

@oliverfoster
Copy link
Member Author

oliverfoster commented Dec 12, 2018

graphic, text, blank and media still need doing.

@moloko
Copy link
Contributor

moloko commented Dec 13, 2018

graphic, text, blank and media still need doing.

what do you envisage going into the models for those?

@oliverfoster
Copy link
Member Author

Nothing, just the bog standard model. They just need to conform to the model / view separation standard. I'd like to kill off "view only" components.

@moloko
Copy link
Contributor

moloko commented Dec 17, 2018

Oh right, I see - something a bit like this?

return Adapt.register('blank', {
        model: ComponentModel.extend({}), // Need to create a new class in the inheritance chain so that it can be extended per component type if necessary later
        view: BlankView
});

@oliverfoster
Copy link
Member Author

oliverfoster commented Dec 17, 2018

Exactly. Then we can drop all that compatibility rubbish from QuestionView (not that it's needed for the presentation components, it will just feel a lot cleaner).

@moloko
Copy link
Contributor

moloko commented Dec 17, 2018

Excellent. Would you be happy to keep the view code in adapt-contrib-blank.js - or would you want it moved to a separate .js file?

@oliverfoster
Copy link
Member Author

oliverfoster commented Dec 17, 2018

It's fine in the main file I think. I'd prefer a separate file as an example for everyone to follow but it's really only a stylistic wish. (I updated your code example btw ^ just so that you notice)

@moloko
Copy link
Contributor

moloko commented Dec 17, 2018

OK all done

moloko added a commit to adaptlearning/adapt-youtube that referenced this issue Feb 16, 2019
* proper transcript functionality
* skip to transcript option
* play, pause and ended events (as per adaptlearning/adapt_framework#2344)
* configuration for player controls & fullscreen
* proper use of ComponentModel (as per adaptlearning/adapt_framework#1179)
moloko added a commit to adaptlearning/adapt-youtube that referenced this issue Mar 22, 2019
* proper transcript functionality
* play, pause and ended events (as per adaptlearning/adapt_framework#2344)
* configuration for player controls & fullscreen
* proper use of ComponentModel (as per adaptlearning/adapt_framework#1179)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants