Glossary

Importing into Moodle

 
Picture of Philip Zablocki
Importing into Moodle
 

I am wondering if there is an automated way to import information into moodle. I have a Glossary of about 750 terms in an excel document that I would like to input. Is there an automated way to insert these terms, (possibily a way for moodle to recognize the first column as the term and the second column as the definition). Any advice would be greatly appreciated.

 
Average of ratings: -
Picture of Helen Foster
Re: Importing into Moodle
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Hi Philip,

You can import glossary terms into a Moodle glossary via XML file. If you create a glossary in Moodle and add a few entries, then try exporting them, an XML file will be created, which you can use to figure out the format of your XML file. Please see Import glossary entries for more details, and the Import and export FAQ for other ways of importing data into Moodle.
 
Average of ratings: -
Picture of Philip Zablocki
Re: Importing into Moodle
 

I have a XML file of some entries that I imputed manual, but I am unsure as to what to do now. Would I have to code all of the glossary entries into XML format, because if so it would probably take me longer than imputing them manually.

OR

Is there a way to import it automatically using XML.

 
Average of ratings: -
Picture of Philip Zablocki
Re: Importing into Moodle
 
Just to rephrase, what is the procedure for creating an XML file from my excel workbook of all the terms.
 
Average of ratings: -
Picture of Todd Watkins
Re: Importing into Moodle
 

Thank you Helen. You just saved me a bunch of work!!

 

Philip maybe this will work for you…..

 

I just set up and started using Moodle. I had 453 terms that need to be made into a glossary for my Biology students. I had the terms in an excel workbook. I am not a programmer. I don’t know XML, but using Helen’s suggestion I was able to do the import. Here’s how….

 

First, I exported a Moodle glossary with a few of the term as suggested.

 

Then I downloaded a free XML writer called XMLwriter2 (http://xmlwriter.net/ I couldn’t tell you anything about this program except it was free and cleared my virus software). I used this because attempts to import files which were saved as xml did not work.

 

Then I opened the Excel workbook file and deleted everything that was not a term or definition. This left one column with the term and another column with the definition.

 

I then opened up the exported Moodle glossary file using the XML writer to see how the terms and definitions were formatted.

 

Next, on the Excel worksheet I inserted column before the terms, and a column after the term. I then went back to the XML writer copied what was before the terms into column A in the spreadsheet (<ENTRY><CONCEPT>).

 

Now back to the XML writer and copied what was between the term and definition and pasted this into column C of the spreadsheet. (</CONCEPT><DEFINITION>&lt;p&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;). Note: Column B has the term.

 

Finally I copied from XML writer what was after the definition into column E. (<FORMAT>1</FORMAT><USEDYNALINK>0</USEDYNALINK><CASESENSITIVE>0</CASESENSITIVE>

<FULLMATCH>0</FULLMATCH><TEACHERENTRY>1</TEACHERENTRY></ENTRY>)

 

Next, I copied all the columns and pasted them into a Word document. In Word the pasted material was in a table so I highlighted the table and then converted the table to text using paragraph marks.

 

Then I copied from XML writer the beginning part of the exported Moodle glossary into the top of the Word document. This part for my files was from the line “<?xml version="1.0" encoding="UTF-8"?>“ to the line which ended as <ENTRIES>. I copied the ending code from XML writer of the exported file which was </ENTRIES></INFO></GLOSSARY> to the end of the terms in the Word file. With all of the copying I made sure there were no spaces between the letters.

 

Next, I copied the entire Word file into a new XML file in the XML writer program and saved the file. This is the file I imported into the glossary. Only a couple of terms did not import.

 

Once I had figured this out, it only took me abou 20 minutes to do the import. Again, I am no tech and there is probably a cleaner way of doing this. Maybe it will work for you.

 
Average of ratings: Useful (2)
Picture of Helen Foster
Re: Importing glossary entries into Moodle
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersTestersTranslators
Todd, thanks a lot for your helpful explanation. approve I've added a link to this discussion in Import glossary entries so others can easily find it, plus I'm going to move this discussion thread to the glossary module forum.
 
Average of ratings: -
Picture of Marc Grober
Re: Importing glossary entries into Moodle
 
The crux to such solutions is mapping the XML scema and if you search the net for example for "XML map excel" you will find a number of articles on addressing this issue in a more "elegant" manner. The process begs the question of making such schema easily accessible so as to avoid having to reinvent the schema from an XML export.
 
Average of ratings: -
Frank Ralf
Moodle Glossary XML Schema
Documentation writersPlugin developers
This is a very first stab at creating an XML Schema (http://en.wikipedia.org/wiki/XML_Schema_(W3C)) for the Moodle glossary format. It was created automatically using Liquid XML Studio (http://www.liquid-technologies.com/XmlStudio/XmlStudio.aspx).

I'm sure it needs some refinement, but it might be a starting point.

hth
Frank
Picture of Joseph Rézeau
Re: Moodle Glossary XML Schema
Core developersParticularly helpful MoodlersPlugin developersTestersTranslators
Which reminds me I had produced an xsd schema for glossary back in November 2006. No guarantee it still works!
Joseph
 
Average of ratings: -
Frank Ralf
Re: Moodle Glossary XML Schema
Documentation writersPlugin developers
Just found this XML Schema Diagram for Glossary, also dating back to 2006: http://moodle.org/mod/forum/discuss.php?d=43332
 
Average of ratings: -
Picture of Philip Zablocki
Re: Importing glossary entries into Moodle
 
Use the schema from the XML file Moodle Exported. See below for my explanation with screenshots
 
Average of ratings: -
Frank Ralf
Re: Importing into Moodle
Documentation writersPlugin developers
Hi Todd,

If you have your XML code ready in Word I think you can leave out that last step (copying everything into XML writer). Instead you can just use Word's "Save as text" function to save your XML as plain text file. You just have to make sure the encoding is UTF-8 and you might change the file extension to .xml. (Word might also offer to save your document as XML, don't do that!).

hth
Frank

 
Average of ratings: -
Picture of David Fountain
Re: Importing into Moodle
 
Yes, I wrote an Excel convertor and Yasu Imao did something similar, you can get the scripts and forum discussion here: http://moodle.org/mod/forum/discuss.php?d=79120#p536148
 
Average of ratings: -
Frank Ralf
Re: Importing into Moodle
Documentation writersPlugin developers
Hi Philip,

A very easy and elegant solution is Yasu Imao's Moodle glossaryXMLconverter_html (http://moodle.org/mod/forum/discuss.php?d=91224&parent=489666). It's a JavaScript based converter that works directly in your browser.

I added that link also to Import glossary entries.

Cheers,
Frank
 
Average of ratings: -
Picture of Philip Zablocki
Re: Importing into Moodle
 

I found that keeping things simple is the best solution.

I downloaded an XML plug-in for Excel. I had all the terms in Column A, and their corresponding definitons in column B.

Using the XML add-in, I converted a range into an XML list. From here the XML mapping is done automatically. I saved this file as XML and it worked like a charm.

I found i wasted ALOT of time trying to use the file that Moodle exported, and to play around with the mappings. This took a long time and led to no where.

***The one problem that I ran into was that my glossary had some characters that are not recognized by Moodle. One character in particular, a quesiton mark with a box around it. I found that I spent most of my time figuring out that this character was the problem. Unknowlingly, I thought that the problem lied in the XML mapping, however this was not the case***

So if you find that Moodle does not want to import your glossary please make sure that you do not have any strange characters in the file you want to upload!

 
Average of ratings: -
Picture of john ivanac
Re: Importing into Moodle
 

Hi Phil,

Can you suggest a good XML plug-in for Excel. I have about 200 terms I want to import into a moodle glossary and anything that will make this process more efficient would be great.

Thanks

John Ivanac

(TAFE NSW Sydney Australia)

 
Average of ratings: -
Picture of Philip Zablocki
Re: Importing into Moodle
 

I used this XML add-in

http://www.microsoft.com/downloadS/details.aspx?FamilyID=72852247-6afd-425c-83b1-1f94e4ac2775&displaylang=en

Another thing you can do is manually insert a term or two into the glossary. Then export the glossary and save it to your computer. Then in Excel, go to the developer tab (if its not visible on your excel you can go into excel options and check the box that says "Show Developer Tab in the Ribbon"). In the developer tab click the "Source" button.  This will open a toolbar on the right side of your screen. From there Click XML maps and select the file that moodle exported

I made a doc with screenshots to help you out!

http://www.mediafire.com/?sharekey=bd5675a572b14675aaca48175a79d1c3e04e75f6e8ebb871

I had to use mediafire, because Moodle has a very unforgiving 100KB limit....

 
Average of ratings: -
Picture of Ule Hacker
Re: Importing into Moodle
 
After having difficulties importing, because there were utf characters, which moodle seemed not to like in Version 1.9, and I do not want to use Microsoft Office products anymore, I came up with a copy / paste solution, which seems to work without flaws.
You need:
  1. openoffice Calc
  2. Yasu Imao's Moodle glossaryXMLconverter_html
  3. MIcrosoft XML Notepad (free download but needs net2)
Using other languages than English in Moodle, makes it often tricky to get out of the trouble. This is my solution:
  1. Start openoffice Calc with an empty table
  2. Start glossaryXMLconverter_html in your Browser (Firefox/IE7 or whatever)
  3. Start MIcrosoft XML with an empty file
  4. Write your list into openoffice Calc columns A B (C D)*
  5. Select the entries and CTRL-C to copy the list
  6. Switch to the Browser
  7. Paste with CTRL-V the list into the left window
  8. Click CONVERT
  9. Copy the entire converted list in the right window with CTRL-A CTRL-C
  10. Switch to Microsoft XML Notepad
  11. Paste with CTRL-V the list into the right editor field
  12. Save the file (xxx.xml)
What the last two steps do for you is, the editor seems to convert the characters properly into the html format. If you try to write e.g. : »this …never would work« and only copy the from glossaryXMLconverter_html converted xml file into a normal editor, Moodle would fail later.
 
Average of ratings: -