SlideShare une entreprise Scribd logo
1  sur  20
Automating Content Import
David Lippman
Pierce College
Lumen Learning
The Problem
You have large quantities of content (text,
quizzes, etc.) you want in Canvas.
Option 1: Cut and Paste
Option 2: Use the API
Option 3: Build a course cartridge
Key Format
Common Cartridge
• Basis for Canvas’s export format
• Exports are renamed zip files
Cartridge Components
Course settings XML
Files info XML
Syllabus HTML
Module layout as
modules_meta.xml
Using this will provide a more
predictable Module structure
than using standard common
cartridge
Cartridge Components
One folder per
assignment/discussion/quiz
Quizzes contain:
assessment_meta.xml
Display settings
assessment_qti.xml
Actual questions, in QTI format
Cartridge Components
All the wiki pages for the
course, in HTML format
Note: spaces and dots in wiki
page names get converted to
dashes in the file name.
Cartridge Components
The main mainfest for the whole
cartridge
<resource>
shows type and location of items
<organization> <item>
shows item structure (modules)
Best way to get familiar
Export a course
Rename it .zip and unzip it
Go exploring
So what can we do with this?
Universal search and replace on all wiki pages
Approach 1:
• Unzip the cartridge
• Use an editor that can do multi-file search
and replace
• Run against the wiki_content directory
• Rezip and upload
So what can we do with this?
Universal search and replace on all wiki pages
Approach 2:
• Write a script
require("phpQuery-onefile.php");
$zip = new ZipArchive;
$zip->open($file);
phpQuery::newDocumentXML(
$zip->getFromName("imsmanifest.xml"));
$ref = pq("resource");
foreach ($ref as $r) {
$reflist[pq($r)->attr("identifier")] =
pq($r)->attr("href");
$reftype[pq($r)->attr("identifier")] =
pq($r)->attr("type");
}
$items = pq(“item”);
foreach ($items as $item) {
$iref = pq($item)->attr("identifierref");
if (isset($reftype[$iref]) &&
$reftype[$iref]=="webcontent") {
$filename = $reflist[$iref]);
$html = $zip->getFromName($filename);
$html = str_replace(„</body>‟,
$attribution.‟</body>‟, $html);
$zip->addFromString($filename, $html);
}
}
So what can we do with this?
Import a collection of files as wiki pages
• Start with a clean export file
• Add pages in wiki_content
• Add new <resource> listings
• Add new <item> to imsmanifest and
modules_meta
• Or, just create new imsmanifest and
modules_meta files
QTI
• Standard format for quiz exchange
• Can import a QTI quiz into Canvas without a
full cartridge
Making it Easier
Generate QTI files from HTML or pasted Word
https://www.myopenmath.com/util/wordtoquiz.php
https://www.myopenmath.com/util/wordtoquiz2.php
https://www.myopenmath.com/util/wordtoquiz3.php
Sample Code
https://github.com/drlippman/canvas-scripts
• Search-and-replace in a cartridge example
• Generic content-to-CC
• Some specific examples of content-to-CC
• QTI generating scripts

Contenu connexe

Tendances

Distributed training of Deep Learning Models
Distributed training of Deep Learning ModelsDistributed training of Deep Learning Models
Distributed training of Deep Learning Models
Miguel González-Fierro
 

Tendances (14)

KubeCon EU 2016: Custom Volume Plugins
KubeCon EU 2016: Custom Volume PluginsKubeCon EU 2016: Custom Volume Plugins
KubeCon EU 2016: Custom Volume Plugins
 
Tax management-system
Tax management-systemTax management-system
Tax management-system
 
Cscope and ctags
Cscope and ctagsCscope and ctags
Cscope and ctags
 
REST API with CakePHP
REST API with CakePHPREST API with CakePHP
REST API with CakePHP
 
Intro to CouchDB
Intro to CouchDBIntro to CouchDB
Intro to CouchDB
 
Modern php
Modern phpModern php
Modern php
 
Integrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMSIntegrating Google Search Appliance with Mura CMS
Integrating Google Search Appliance with Mura CMS
 
Rapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and FirebaseRapid Application Development with SwiftUI and Firebase
Rapid Application Development with SwiftUI and Firebase
 
Pig
PigPig
Pig
 
Distributed training of Deep Learning Models
Distributed training of Deep Learning ModelsDistributed training of Deep Learning Models
Distributed training of Deep Learning Models
 
Practical pig
Practical pigPractical pig
Practical pig
 
Check if a directory exists - ansible module stat
Check if a directory exists - ansible module statCheck if a directory exists - ansible module stat
Check if a directory exists - ansible module stat
 
Apache mod_rewrite
Apache mod_rewriteApache mod_rewrite
Apache mod_rewrite
 
Intermediate OOP in PHP
Intermediate OOP in PHPIntermediate OOP in PHP
Intermediate OOP in PHP
 

Similaire à Automating Content Import

PHP-05-Objects.ppt
PHP-05-Objects.pptPHP-05-Objects.ppt
PHP-05-Objects.ppt
rani marri
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
henri_makembe
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
Fahad Noaman
 
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
Peter Keane
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
Kris Wallsmith
 

Similaire à Automating Content Import (20)

Wiesław Kałkus: C# functional programming
Wiesław Kałkus: C# functional programmingWiesław Kałkus: C# functional programming
Wiesław Kałkus: C# functional programming
 
Bioinformatics p5-bioperlv2014
Bioinformatics p5-bioperlv2014Bioinformatics p5-bioperlv2014
Bioinformatics p5-bioperlv2014
 
ITPROceed 2016 - The Art of PowerShell Toolmaking
ITPROceed 2016 - The Art of PowerShell ToolmakingITPROceed 2016 - The Art of PowerShell Toolmaking
ITPROceed 2016 - The Art of PowerShell Toolmaking
 
Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018
 
Bioinformatica p6-bioperl
Bioinformatica p6-bioperlBioinformatica p6-bioperl
Bioinformatica p6-bioperl
 
PHP-05-Objects.ppt
PHP-05-Objects.pptPHP-05-Objects.ppt
PHP-05-Objects.ppt
 
Bioinformatics p5-bioperl v2013-wim_vancriekinge
Bioinformatics p5-bioperl v2013-wim_vancriekingeBioinformatics p5-bioperl v2013-wim_vancriekinge
Bioinformatics p5-bioperl v2013-wim_vancriekinge
 
Assetic (OSCON)
Assetic (OSCON)Assetic (OSCON)
Assetic (OSCON)
 
OOP Adventures with XOOPS
OOP Adventures with XOOPSOOP Adventures with XOOPS
OOP Adventures with XOOPS
 
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperlBioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
 
WordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a FrameworkWordPress Café: Using WordPress as a Framework
WordPress Café: Using WordPress as a Framework
 
CodeIgniter & MVC
CodeIgniter & MVCCodeIgniter & MVC
CodeIgniter & MVC
 
Helberg acl-final
Helberg acl-finalHelberg acl-final
Helberg acl-final
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
Magento code audit
Magento code auditMagento code audit
Magento code audit
 
FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3FFW Gabrovo PMG - PHP OOP Part 3
FFW Gabrovo PMG - PHP OOP Part 3
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
The Role of Atom/AtomPub in Digital Archive Services at The University of Tex...
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 

Plus de David Lippman (8)

My Journey to Open - USNH ATI 2015
My Journey to Open - USNH ATI 2015My Journey to Open - USNH ATI 2015
My Journey to Open - USNH ATI 2015
 
OER Update for FACTC Oct 2014
OER Update for FACTC Oct 2014OER Update for FACTC Oct 2014
OER Update for FACTC Oct 2014
 
The Case for Open
The Case for OpenThe Case for Open
The Case for Open
 
Kaleidoscope Overview of Copyright
Kaleidoscope Overview of CopyrightKaleidoscope Overview of Copyright
Kaleidoscope Overview of Copyright
 
Open Course Library presentation, AMATYC 2013
Open Course Library presentation, AMATYC 2013Open Course Library presentation, AMATYC 2013
Open Course Library presentation, AMATYC 2013
 
Santa Ana Open Math Forum
Santa Ana Open Math ForumSanta Ana Open Math Forum
Santa Ana Open Math Forum
 
Understanding Copyright and Remixing by Example
Understanding Copyright and Remixing by ExampleUnderstanding Copyright and Remixing by Example
Understanding Copyright and Remixing by Example
 
Denver
DenverDenver
Denver
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Automating Content Import

  • 1. Automating Content Import David Lippman Pierce College Lumen Learning
  • 2. The Problem You have large quantities of content (text, quizzes, etc.) you want in Canvas. Option 1: Cut and Paste Option 2: Use the API Option 3: Build a course cartridge
  • 3. Key Format Common Cartridge • Basis for Canvas’s export format • Exports are renamed zip files
  • 4. Cartridge Components Course settings XML Files info XML Syllabus HTML Module layout as modules_meta.xml Using this will provide a more predictable Module structure than using standard common cartridge
  • 5. Cartridge Components One folder per assignment/discussion/quiz Quizzes contain: assessment_meta.xml Display settings assessment_qti.xml Actual questions, in QTI format
  • 6. Cartridge Components All the wiki pages for the course, in HTML format Note: spaces and dots in wiki page names get converted to dashes in the file name.
  • 7. Cartridge Components The main mainfest for the whole cartridge <resource> shows type and location of items <organization> <item> shows item structure (modules)
  • 8.
  • 9. Best way to get familiar Export a course Rename it .zip and unzip it Go exploring
  • 10. So what can we do with this? Universal search and replace on all wiki pages Approach 1: • Unzip the cartridge • Use an editor that can do multi-file search and replace • Run against the wiki_content directory • Rezip and upload
  • 11. So what can we do with this? Universal search and replace on all wiki pages Approach 2: • Write a script
  • 12. require("phpQuery-onefile.php"); $zip = new ZipArchive; $zip->open($file); phpQuery::newDocumentXML( $zip->getFromName("imsmanifest.xml")); $ref = pq("resource"); foreach ($ref as $r) { $reflist[pq($r)->attr("identifier")] = pq($r)->attr("href"); $reftype[pq($r)->attr("identifier")] = pq($r)->attr("type"); }
  • 13. $items = pq(“item”); foreach ($items as $item) { $iref = pq($item)->attr("identifierref"); if (isset($reftype[$iref]) && $reftype[$iref]=="webcontent") { $filename = $reflist[$iref]); $html = $zip->getFromName($filename); $html = str_replace(„</body>‟, $attribution.‟</body>‟, $html); $zip->addFromString($filename, $html); } }
  • 14. So what can we do with this? Import a collection of files as wiki pages • Start with a clean export file • Add pages in wiki_content • Add new <resource> listings • Add new <item> to imsmanifest and modules_meta • Or, just create new imsmanifest and modules_meta files
  • 15. QTI • Standard format for quiz exchange • Can import a QTI quiz into Canvas without a full cartridge
  • 16.
  • 17.
  • 18.
  • 19. Making it Easier Generate QTI files from HTML or pasted Word https://www.myopenmath.com/util/wordtoquiz.php https://www.myopenmath.com/util/wordtoquiz2.php https://www.myopenmath.com/util/wordtoquiz3.php
  • 20. Sample Code https://github.com/drlippman/canvas-scripts • Search-and-replace in a cartridge example • Generic content-to-CC • Some specific examples of content-to-CC • QTI generating scripts

Notes de l'éditeur

  1. Before you start:Load up a Canvascourse https://lumen.instructure.com/courses/196787Load up one of the wordtoquiz.php pagesPaste in some quiz questions
  2. Show a course