Automating the Posting of Content on Moodle Roger Kenner Moodle Consultant & Trainer RK-Id ées, Montreal
An Overview of the Process <ul><li>Posting a large number of structurally similar units on a  Moodle  course </li></ul><ul...
Accessible to those who... <ul><li>Are comfortable with  Excel ,  Word ’s  mailmerge  utility,  text  files and manipulati...
The Task <ul><li>A major Canadian university and a major textbook publisher </li></ul><ul><ul><li>(Neither will be cited h...
Clearly some sort of  tool  was called for... After preliminary testing, to prove the concept, I proceeded with the constr...
Constructing the Tool
Step 1:  Creating the Backup <ul><li>Build a model unit containing all elements </li></ul><ul><ul><li>(Actually more than ...
Step 2:  Examining the Backup <ul><li>course_files contains all files used in the links </li></ul><ul><li>moodle.xml conta...
Step 2:  Examining the Backup <ul><li>Placeholder  for all links not actually used </li></ul><ul><ul><li>(So there are no ...
Step 3:  Examining the XML <ul><li>Only 3 Key sections : </li></ul><ul><ul><li><info><details>... </li></ul></ul><ul><ul><...
Step 3:  Examining the XML <ul><li>Every  Instance  has </li></ul><ul><li><id>...</id> </li></ul><ul><ul><li>used internal...
Step 3:  Examining the XML <ul><li>All  Sections  are empty except one </li></ul><ul><li>Each section has a </li></ul><ul>...
Step 3:  Examining the XML <ul><li>Need more sections? </li></ul><ul><ul><li><course><header> </li></ul></ul><ul><ul><ul><...
Step 3:  Examining the XML <ul><li>Items grouped by type under Modules: First the labels </li></ul><ul><ul><li>Match ID an...
Step 3:  Examining the XML <ul><li>Then resources:  “Compose a Web Page” </li></ul><ul><ul><li>Match ID and Name to <insta...
Step 3:  Examining the XML <ul><li>Then resources:  “Link to a File” </li></ul><ul><ul><li>Match ID and Name to <instance>...
Step 4:  Create the Spreadsheet <ul><li>Two worksheets </li></ul><ul><ul><li>Datasheet: Field names in row 1 and data in r...
Step 4:  Create the Spreadsheet <ul><li>When filling in Entrysheet </li></ul><ul><ul><li>All data will be linked to datash...
Step 5:  Prepare the Mailmerge <ul><li>Word  does not want to open XML files as text, even if you change the filename exte...
Step 5:  Prepare the Mailmerge <ul><li>Use  mailmerge  wizard </li></ul><ul><li>Carefully replace text with variable names...
Using the Tool
Step 1: Prepare the files <ul><li>Copy the backup.zip file, naming it for the new unit </li></ul><ul><li>Replace all the o...
Step 2: Fill in the Spreadsheet <ul><li>Enter all labels, titles, file names, etc for new unit. </li></ul><ul><li>Name any...
Step 3: Run Mailmerge <ul><li>Open Word document and attach new spreadsheet at data source </li></ul><ul><li>Run mailmerge...
Step 3:  Moving the Section <ul><li>All  Sections  are empty except one </li></ul><ul><li>Each section has a </li></ul><ul...
Step 4: Package backup file <ul><li>Change extension on moodle.txt, to read moodle.xml </li></ul><ul><li>Copy new moodle.x...
Step 5: Restore Backup <ul><li>Upload backup file to Moodle site (must be below site maximum in size) </li></ul><ul><li>Re...
Step 5: Restore Backup <ul><li>Restore as “Existing course, adding to it </li></ul><ul><li>Choose the target course </li><...
Step 5: Restore Backup <ul><li>Select active item to restore </li></ul><ul><ul><li>An X in name of unused items is very he...
Step 6: Tidy Up <ul><li>Check new unit for all items </li></ul><ul><li>Some items may have to be moved </li></ul><ul><ul><...
Upcoming SlideShare
Loading in …5
×

Roger Kenner Automating Posting

588 views

Published on

Presentation by Roger Kenner at Canada Moodle Moot: Friday, April 2, 2009

Using Excel and Mailmerge to modify Moodle backup files so as to load new content into a site.

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
588
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Roger Kenner Automating Posting

  1. 1. Automating the Posting of Content on Moodle Roger Kenner Moodle Consultant & Trainer RK-Id ées, Montreal
  2. 2. An Overview of the Process <ul><li>Posting a large number of structurally similar units on a Moodle course </li></ul><ul><li>Having no access server beyond normal teacher privileges for the sites in question </li></ul><ul><li>Using Excel and Word to modify a carefully constructed Moodle ‘backup’ file </li></ul><ul><ul><li>So as to cause it to place new content on the site </li></ul></ul>
  3. 3. Accessible to those who... <ul><li>Are comfortable with Excel , Word ’s mailmerge utility, text files and manipulating files and file names in Windows </li></ul><ul><li>Are not afraid to work directly with XML code </li></ul><ul><li>Have a meticulous clerical bent </li></ul><ul><li>No programming of scripts in Php or knowledge of MySQL is necessary. </li></ul>
  4. 4. The Task <ul><li>A major Canadian university and a major textbook publisher </li></ul><ul><ul><li>(Neither will be cited here.) </li></ul></ul><ul><li>Posting all supplementary materials for the method onto Moodle , in mostly hidden form </li></ul><ul><ul><li>(Teachers can release materials as needed.) </li></ul></ul><ul><li>Eight textbooks comprising 280 units in total </li></ul><ul><ul><li>(Onto 8 master Moodle sites) </li></ul></ul>
  5. 5. Clearly some sort of tool was called for... After preliminary testing, to prove the concept, I proceeded with the construction of the tool
  6. 6. Constructing the Tool
  7. 7. Step 1: Creating the Backup <ul><li>Build a model unit containing all elements </li></ul><ul><ul><li>(Actually more than shown here; no such original unit exists anymore.) </li></ul></ul><ul><li>Create a backup of only that unit </li></ul>
  8. 8. Step 2: Examining the Backup <ul><li>course_files contains all files used in the links </li></ul><ul><li>moodle.xml contains all entries from Moodle database pertinent to what was backed up </li></ul>
  9. 9. Step 2: Examining the Backup <ul><li>Placeholder for all links not actually used </li></ul><ul><ul><li>(So there are no broken links) </li></ul></ul>
  10. 10. Step 3: Examining the XML <ul><li>Only 3 Key sections : </li></ul><ul><ul><li><info><details>... </li></ul></ul><ul><ul><ul><li>Instances </li></ul></ul></ul><ul><ul><li><course> </li></ul></ul><ul><ul><ul><li>Sections </li></ul></ul></ul><ul><ul><li><course> </li></ul></ul><ul><ul><ul><li>Modules </li></ul></ul></ul><ul><li>Carefully note and label each item which must be changed </li></ul>
  11. 11. Step 3: Examining the XML <ul><li>Every Instance has </li></ul><ul><li><id>...</id> </li></ul><ul><ul><li>used internally to link the 3 sections </li></ul></ul><ul><ul><li>You will not touch this, but must note it </li></ul></ul><ul><li><name>...</name> </li></ul><ul><ul><li>Name given to item </li></ul></ul><ul><ul><li>Hidden for labels </li></ul></ul><ul><ul><li>Visible for resources </li></ul></ul>
  12. 12. Step 3: Examining the XML <ul><li>All Sections are empty except one </li></ul><ul><li>Each section has a </li></ul><ul><ul><li><number></number> </li></ul></ul><ul><li>During operation </li></ul><ul><ul><li>Empty section moved above active section </li></ul></ul><ul><ul><li>Section number changed to reflect new order </li></ul></ul><ul><ul><li>Active section now points to empty section on site </li></ul></ul>
  13. 13. Step 3: Examining the XML <ul><li>Need more sections? </li></ul><ul><ul><li><course><header> </li></ul></ul><ul><ul><ul><li>Numsections </li></ul></ul></ul><ul><li>Recommend setting correct number of sections in course before beginning process </li></ul>
  14. 14. Step 3: Examining the XML <ul><li>Items grouped by type under Modules: First the labels </li></ul><ul><ul><li>Match ID and Name to <instance> </li></ul></ul><ul><ul><ul><li>(Modules are NOT in display order) </li></ul></ul></ul><ul><ul><li>You will need to change Name (as in <instance>) and <content> </li></ul></ul><ul><ul><li>Avoid formatting changes (&lt; &gt; &quot;) </li></ul></ul>
  15. 15. Step 3: Examining the XML <ul><li>Then resources: “Compose a Web Page” </li></ul><ul><ul><li>Match ID and Name to <instance> </li></ul></ul><ul><ul><li>You will need to change Name (as in <instance>) and <alltext>, possibly <summary> </li></ul></ul><ul><ul><li>Avoid formatting changes (&lt; &gt; &quot;) </li></ul></ul>
  16. 16. Step 3: Examining the XML <ul><li>Then resources: “Link to a File” </li></ul><ul><ul><li>Match ID and Name to <instance> </li></ul></ul><ul><ul><li>You will need to change Name (as in <instance>) and <reference>, possibly <summary> </li></ul></ul><ul><ul><li>Recommend keeping path constant </li></ul></ul>
  17. 17. Step 4: Create the Spreadsheet <ul><li>Two worksheets </li></ul><ul><ul><li>Datasheet: Field names in row 1 and data in row 2 </li></ul></ul><ul><ul><li>All data will be linked from second worksheet: Entrysheet </li></ul></ul><ul><ul><ul><li>(Slowly and carefully) </li></ul></ul></ul>
  18. 18. Step 4: Create the Spreadsheet <ul><li>When filling in Entrysheet </li></ul><ul><ul><li>All data will be linked to datasheet </li></ul></ul><ul><ul><li>Start Name of any unused item with X </li></ul></ul><ul><ul><li>Use copy and paste for file name </li></ul></ul><ul><ul><ul><li>(Files already in place, no errors in transcription) </li></ul></ul></ul><ul><li>Point any unused links to Placeholder file </li></ul>
  19. 19. Step 5: Prepare the Mailmerge <ul><li>Word does not want to open XML files as text, even if you change the filename extension </li></ul><ul><ul><li>Use Wordpad (once) to open .txt copy of XML </li></ul></ul><ul><ul><ul><li>Change extension from .xml to .txt </li></ul></ul></ul><ul><ul><li>Change all < to something else #! </li></ul></ul><ul><ul><li>Save as .doc file </li></ul></ul>
  20. 20. Step 5: Prepare the Mailmerge <ul><li>Use mailmerge wizard </li></ul><ul><li>Carefully replace text with variable names </li></ul><ul><li>Save file </li></ul>
  21. 21. Using the Tool
  22. 22. Step 1: Prepare the files <ul><li>Copy the backup.zip file, naming it for the new unit </li></ul><ul><li>Replace all the old files with the new ones for the unit in question </li></ul><ul><li>Make sure ‘Placeholder’ is present in each folder </li></ul>
  23. 23. Step 2: Fill in the Spreadsheet <ul><li>Enter all labels, titles, file names, etc for new unit. </li></ul><ul><li>Name any unused item beginning with X </li></ul><ul><li>Point any unused links to Placeholder file </li></ul><ul><li>Copy and paste file names into spreadsheet </li></ul><ul><li>Save copy of original spreadsheet with name of new unit </li></ul>
  24. 24. Step 3: Run Mailmerge <ul><li>Open Word document and attach new spreadsheet at data source </li></ul><ul><li>Run mailmerge and “edit individual letters” </li></ul><ul><ul><li>(Producing a new document) </li></ul></ul><ul><ul><li>Eyeball document (the first few times), to spot visible errors. Fix spreadsheet and/or Word document and start again </li></ul></ul><ul><li>Shift empty <section> above active <section> and update numbers. (This is a key step!) </li></ul><ul><li>Change all !# back to < </li></ul><ul><li>Save as “plain text” with .txt ending </li></ul>
  25. 25. Step 3: Moving the Section <ul><li>All Sections are empty except one </li></ul><ul><li>Each section has a </li></ul><ul><ul><li><number></number> </li></ul></ul><ul><li>During operation </li></ul><ul><ul><li>Empty section moved above active section </li></ul></ul><ul><ul><li>Section number changed to reflect new order </li></ul></ul><ul><ul><li>Active section now points to empty section on site </li></ul></ul>
  26. 26. Step 4: Package backup file <ul><li>Change extension on moodle.txt, to read moodle.xml </li></ul><ul><li>Copy new moodle.xml into backup zip file </li></ul>
  27. 27. Step 5: Restore Backup <ul><li>Upload backup file to Moodle site (must be below site maximum in size) </li></ul><ul><li>Restore </li></ul>
  28. 28. Step 5: Restore Backup <ul><li>Restore as “Existing course, adding to it </li></ul><ul><li>Choose the target course </li></ul>
  29. 29. Step 5: Restore Backup <ul><li>Select active item to restore </li></ul><ul><ul><li>An X in name of unused items is very helpful here. </li></ul></ul>
  30. 30. Step 6: Tidy Up <ul><li>Check new unit for all items </li></ul><ul><li>Some items may have to be moved </li></ul><ul><ul><li>(Do not even attempt to move items around in the xml file. This technique assumes all units are more or less structurally similar.) </li></ul></ul><ul><li>Add Unit Title, pictures, activities, etc. that were not included in process </li></ul><ul><li>Get ready to do the next unit.... </li></ul>

×