djplaner / word-to-canvas-module

A userscript that will create a Canvas Module (including all module items) from a Word document (using special styles)
https://djplaner.github.io/word-to-canvas-module/
MIT License
0 stars 0 forks source link
instructure-canvas

Word to Canvas (word2canvas) Module

What is word2canvas?

A userscript that will create a new Canvas LMS module from a Word document (using some specific Word styles) - see sample w2c.docx for an annotated example.

:exclamation: The contents of your Word documents always remain on your computer, your web browser, and eventually as a Module in the Canvas instance you are working with.

Why use word2canvas?

Manually creating a complex module using the Canvas web interface can be a touch tedious. Each item must be edited on its individual page. Multiple clicks... Especially if you already have the module content in a Word document and/or you are creating many modules. (e.g. migrating from one LMS to another)

Why not?

  1. Doesn't handle images embedded in Word documents.

    The Canvas editor removes base64 encoded images from HTML. The method word2canvas uses to convert the Word document to HTML converts images to base64 encoded images. The current suggested "solution" requires manual saving of these images and using them to replace placeholder images via the Canvas RCE.

  2. Required to use very specific Word styles.

    Your Word document must use very specific styles to correctly create Canvas Modules and their items. There is a learning curve involved.

  3. Doesn't work for new Quizzes.

    Entirely because Canvas does not yet have an API for new Quizzes.

How to use word2canvas

  1. Install the userscript

    Install a userscript manager (e.g. TamperMonkey) on your browser of choice and then install the word-2-canvas userscript.

  2. Test the userscript

    By creating a module from the sample Word document.

  3. Create a Word document containing content for your new Canvas module.

  4. Visit the modules page of a Canvas course and use word-2-canvas to create a new module.

:grey_question: Feel free to use this repo's Issues to ask questions. Especially in these early development stages.

Canvas modules page with the word-2-canvas button added

Current Status

Note: :warning: `word2canvas is largely working and is being used. There remain some rough edges and missing features.

Currently creates Canvas modules including

To be done

  1. Better error checking and messaging
  2. Figure out how to handle embedded images.

:warning: Known issues

  1. The word-2-canvas button may not always appear on the Modules page. Solution: Reload the modules page. Apparent cause: Navigation between pages in a Canvas course doesn't always invoke word2Canvas to check if it's on the module page. A reload of the modules page forces the issue

    :warning: It appears that this is a particular problem when using Firefox. Chromium-based browsers (e.g. Chrome and Edge) appear to work better.

Development

Userscript

For local development it is suggested to

  1. Use Chrome, with TamperMonkey installed and configured to allow local file acess.
  2. Install the dev userscript version of the userscript.
  3. Modify the dev script updating the local file: require to match the path on your computer.