Create a module using Canvas api
djplaner opened this issue · comments
-
Get script calling API successfully
-
Have a CanvasModule model which has functionality for
- searching for existing module
- creating a module
- getting information on an existing module
- getting information on an existing module's items
-
integrate this into complete stage
-
Update complete stage with appropriate information
-
Figure out if assignments, quiz, file etc can have
- extra content in description within the module
- A different name in the module item, than the actual element
-
add timeouts for the entire process
- early on create a timeout that will generate a fail event at some stage
- handler should make changes to display and perhaps summarise where we were up to
Create module
- Page
- create a new page
- Link to an existing page
- File
- Link to existing
- Discussion
- Link to existing
- Assignment
- Link to existing
- Quiz
- Link to existing
- SubHeader
- Create new
- ExternalUrl
- Create new
- ExternalTool
- link to existing
Implement create module
Just aiming to modify the app to create a new module
completedView.render will start the work
- Call the modules model to create the module and all the items - async
- Set up the view ready to receive the results of the creation process
- register the call back for the event when the conversion is complete
Controller will have a handler for this event ??
Event
- Update the display
Pages being created, but not linked to module
Order of items in module
Items are being added to the module, but not in the order of the Word doc. In part, because the completion of add item to module is not in order Perhaps suggesting that signals need to be used to ensure that item adding occurs in sequence.
Word doc
- Create a new page
- Welcoem to the course
- Canvas Sub Header
- case-law.jpg
- Week 1 Lecture Slides
- Last page of this module
Updates for add item (position indicates espoused message to API)
- Create a new page - position 0
- Canvas Sub Header - position 2
- Welcome to the course - position 1
- case-law.jpg - position 3
- Week 1 Lecture Slides - Position 4
- Last page of this module - position 5
Problem? position should be 1 indexed. Could this be a cause??
Final module
- Create a new page
- Canvas Sub Header
- Welcome to the course
- case-law.jpg
- Week 1 Lecture slides
- Last page of this module
i.e. final module is matching the display, but not the position.
- Check position is being set correctly in code
- Check if the API can handle the wrong one being called first
- Figure out if we need to put in another event cycle