I want to import a list of vocabulary items into my Glossary on Moodle but am not sure how to go about it. I have the list in an Excel file and there are over 1200 items so I really need to figure out how to import them as there is no way that I have the time to put them in one at a time. I assume/hope that I can somehow format/convert the Excel file into an XML file and select the fields that I want to import but don't know for sure if this is possible or not.
I don't know much about XML so I'm already in over my head but I'm getting used to that
Any help will be greatly appreciated.
I just did this recently with a large glossary also...I found a post on this site with info about an excel template...I tried that, but didn't have much success. What I finally ended up doing was entering a couple of glossary entries manually and then exporting those to provide the xml format necessary. Then I set that up in my Excel spreadsheet and inserted my glossary entries/definitions. As far as the XML, you basically need to follow the export...insert your entries between the <entry> and </entry> and then upload/import into your glossary. Attached is a sample of my glossary...good luck!!
Thanks. I tried putting a few entries in and then exporting the glossary but got intimidated but what I saw I'll take a look at the glossary example you attached and give it another shot. Thanks.
The one problem: the glossary's export function doesn't export code for the term's category. On my test export file, for example, I assigned the term to category "X." I could even browse the term under category "X" within the "Browse By Subject" interface in the glossary. But when I exported the test glossary, there was no tag for the term's category: in other words, I couldn't find any code that read something like <CATEGORY>X</CATEGORY>.
Undaunted, in my import XML file, I created a tag called "CATEGORY," and assigned variables ranging from "X" to "Z." I hoped that the categories would be assigned properly once imported. Let's say that 5 of these terms were assigned to Category "X." When I finished importing, I was hoping to browse by Category X, and to see 6 entries under "X." (That is the original term, plus the five imported terms). But only the old entry showed up under Category X.
When I run the moodle import script, the screen reads that 24 terms are imported successfully, and that 24 categories were imported too. But when I try to browse by category, all 24 terms show up as uncategorized.
I even looked at the MySQL table that holds the categories. I saw that each category is assigned a unique numerical ID, which relates to its name. Thus a category with the name "X" shows up with an ID of "1" in the table; "Y" would be "2", etcetra. So I changed the XML, replacing the category's text "X" with the numerical value "1," and "Y" with "2," etcetera. I hoped this hack would work.
When importing this amended file, I got the same message: all 24 terms & categories were imported successfully. Yet again, the 24 new terms all show up as uncategorized. When I looked at the MySQL table, it added an entirely new category--just one category--for all 24 terms. So the table which had three categories before, now had four. The fourth category, however, has a blank name, and all of the 24 imported terms are assigned to this blank category. What am I doing wrong? I'm hoping not to have to assign categories by hand (as I have dozens of terms to import).
Any ideas what I'm doing wrong, or perhaps what the proper XML schema is to include categories along with terms & their definitions? Thanks.
I'm surprised by your saying that Moodle's glossary export function does not export categories because it does (at least in version 1.5 which I am using). Here is an extract from an XML glossary exported file, where you can see the "people" category:
Hope that helps,
I'm using version 1.5.3 and I have imported some glossary terms using import function.
In order to import also the new categories, you must check the appropriate checkbox (in Italian is "Importa Categorie", in english I think "Import Categories").
Here an example of my xml file.
<?xml version="1.0" encoding="UTF-8"?>
<DEFINITION>Scorm eccetera eccetera...</DEFINITION>
<DEFINITION>Prova1 eccetera eccetera...</DEFINITION>
The new category "pippo" was imported succesfully
Hope this can help you.