I would like to make much more use of our glossary entries by using them in a quiz - short questions, for example. I can't figure out how to do it. I know I can use them in the excellent Game module, but for my student a game is not a quiz/test. Is there a way?
I do not really see how one could use the glossary entries for SHORTANSWER questions. Can you expand and provide some examples of how you would do this? On the other hand, it might be interesting to use the glossary entries for MATCHING questions, i.e. match entries with their definitions. Unfortunately this is not possible from the Moodle interface at the moment, it would need some development.
All the best,
thanks for your answer. Well, I often use Jcross from Hot Potatoes for students to practise vocabulary. If you import JCross file to questions, the items from the crosswords import as short questions. So far this has been the technique I've been using. The downsize is, that I have to do double work - I have to create the crosswords and the glossary separately which of course takes a lot of time.
I would be perfect and very useful to be able to use glossary items in questions generally. I think just being able to import (previously exported) glossaries to questions would do.
And yes, being able to use glossaries items for MATCHING question or some other would great.
the export/import thing was the first to try out. But you can only export glossaries in XML which is not the one used in questions. If I tried to import this file into questions I finished with an error message. I have also examined the stucture of both, there seems to be a way of converting the glossary export file to questions XML manualy using Find/Replace, but the result is not guaranteed and its very tiring. I'm not a programmer so writing my own piece of code is out of the question
Converting one XML format into another is usually done using XSLT. I've started exploring the possibilities some time ago but haven't come far yet. You might have a look at User:Frank Ralf/Moodle XML1 and XML FAQ.
It would be nice if you could post a short sample XML file here for further investigation.
here is a sample of XML exported from questions and a sample from glossary export. Hope it helps. I've tried converting the file using a AutoHotKey script, but no result so far.
I've already dabbled a bit myself, see http://docs.moodle.org/en/User:Frank_Ralf/Converting_Moodle_glossary_XML_to_question_XML
As I understand the basic mapping is as follows:
<DEFINITION>Gorillas are the largest of the primates.</DEFINITION>
<answer>Gorillas are the largest of the primates.</answer>
There's also a Moodle for Language Teaching forum which might be interesting for you: http://moodle.org/course/view.php?id=31
Joseph, this sounds like heaven! Thanks a lot!
After 3 days' hard work I am pleased to offer a beta version of the "Export Glossary to Quiz" block. Before releasing it in the Moodle plugins database, I invite moodlers to test it on my test site and report here any bugs or wishes for new features (not too many of either, hopefully).
Go to my test site http://rezeau.info/moodle/ and login as teacher01, password Teacher01! and go to the Demo course. Please note that that demo course has limited capacities for the teacher role, but those should suffice for the test.
A. Export from Glossary to moodle quiz XML file
- You don't need to be in Edit mode to configure the Export Glossary to Quiz block. Just click on the Configuration icon.
- Select one of the available glossaries in that course. For a quick test, I suggest selecting the Nature Glossary, either All entries or one of its categories.
- Maximum number of entries to export: this is default-set to 999. You do not need to change that value.
- Remove glossary autolinks in question text? Because the final goal of that block is to make glossary entries & definitions available as quiz questions, and the question texts might contain entries to one or the other of the course glossaries, and autolinks to these might be "too helpful" to the student, you are advised to set this option to Yes. Please note that in moodle 2.0 autolinking can be switched on or off as a setting, so this setting will not be needed in the 2.0 version of this block.
- When done, click OK.
- You are back in the course homepage, but now the block displays the settings you have selected.
- Click on the glossary's name link (e.g. Nature Glossary)
- Now you are on page Demo ► Glossaries ► (e.g.) Nature Glossary ► Export entries to Quiz (XML)
- Click on the Export entries to file button.
- At the prompt, save file to your computer. Its name is e.g. Nature_Glossary.xml.
- Go back to the course's homepage. You see that the the Export Glossary to Quiz block has been reset.
B. Import to the quiz questions bank
- Turn editing on
- In Administration block, click Questions
- On the Edit questions page, Click the Import tab
- Set these settings:
File format : Moodle XML format
Get category from file (check it)
Import from file upload...
- Go to the file you saved to your computer in step A 10 (Nature_Glossary.xml. and click Upload this file button.
- If all goes well, the imported questions should get displayed on the next screen.
- Click Continue.
- On the next page, the Question bank displays the new category name (formed on the name of the exported Glossary, plus the name of its category if you selected one of the glossary's categories) and of course all the questions that were imported (of the SHORTANSWER type).
- You can use those questions in a quiz.
- Or you can use those questions to create one or more Random Short-Answer Matching questions.
I have just tested the block, everything seems to work perfectly. Everything is clean and clear, even pictures are exported/imported. Great job! What's the emoticon for "STANDING OVATION"?
Great job, indeed. Thank you very much!
I have imported your nature quiz. So smooth, so clear, so easy. Thank you for your hard work. This is a very valuable addition to the glossary module, and I hope you release the block soon. I'm sure I will be able to find a use for it with my students in January.
A wonderful addition,
See improved version of the "Export Glossary to Quiz" block on my moodle test site (address above). New features: online help buttons; sort exported entries : by alphabetical order, randomly or by latest modified.
Still waiting for more testing and bug fixing before committing to the modules and plugins database.
I've created a Lo-Tech version of this initiative. It may be useful for those who can't freely add plugins. It's database activity based. Preset should be attached.
The procedure is not as neat as the above but ...
- Create a database activity using the attached preset.
- Export the desired glossary
- Exporting the glossary produces an xml file which can be stored anywhere on your computer.
- The glossary does not need to reside in the same course as the database activity.
- Add an entry for that glossary to the database activity.
- The entry consists of a file field.
- Browse the glossary export file and upload it to the entry.
- In the single view of the entry
- A list of all the glossary entries should be displayed.
- Select how many entries to export
- All - all entries (the number of entries should be displayed)
- None - clear all entries (0)
- Any number of entries from the befining of the list - enter the number of entries in the text field and click Go.
- Check or uncheck individual entries in the list - number of selected entries should be updated in the text field (don't click Go)
- Select the desired question type
- Currently supports short answer or multiple choice.
- Multiple choice are by default 4 options, shuffled. Distractors are selected randomly from the whole list.
- Click 'Generate Quiz XML' to generate quiz xml
- A textarea containing the question import xml should appear in the top right corner.
- Select and copy the question import xml from the textarea
- Paste the question import xml into a text file on your computer.
- Import the questions from file by 'import from file upload' into the desired questions category.
I tried to use your database exporter just now and failed.
I first exported as multi-choice and tried to import. Got the failed message that there are no questions.
Then I exported as short answer and tried to import. Got the failed message that the file is empty.
When I pasted the copy into EditpadPro and saved, I got a message that I was working in Windows 1250 and Editpad would save as UTF-8, which I OKed. For both short answer and multi-choice, I fail.
One file is attached. Apparently, I'm not allowed to attach more than one.
The problem does come from the way you copy-pasted the "exported questions" into your text editor.
There is an error coding in the apostrophe in "Here's" which shows as follows in your file:
Repetition of initial consonant sounds in words placed close together [Hereҳ a blob a bit like a bowler hat
I have edited your file in Dreamweaver and saved and the import into questions database works fine, after DW has automatically transformed the above into
Repetition of initial consonant sounds in words placed close together [Heres a blob a bit like a bowler hat
I think that is the limit of Itamar's solution, it involves one potentially dangerous copy-paste feature. My own block solution does not have this problem. I am in the process of refining my block, but any-one wanting to trying out is welcome to email me (see my profile) for a copy.
Fortunately this limit seems limited enough to be resolvable. The attached revised preset should not encounter these problems. I even tested it with a paragraph copied directly from Word. I just added a very simple function that converts any character in the generated xml whose code is greater than 127 to its html character code (e.g. ’ is converted to ’).
Just tried it, works fine. Brilliant. When I think that you must have knocked this out in a couple of hours whilst it took me more than 3 full days to produce my little block...
Just goes to show that there are always more than one way to do things. It is also a good reminder that the database activity can do more than its name implies, and is probably a neglected resource.
A couple of hours, yes, but if you consider that for this solution I've merely glued together some code snippets which I already implemented and tested in other solutions (some of which are also posted in these forums) this is in a sense a couple of fairly long hours.
Absolutely agree that the database may be given a bit more attention. In fact I've started doing just that but have put it on hold until 2.0 is stable (which is just an excuse to buy a bit more time before I dive into that ).
New version of block available for testing on my test site. Most of the instructions in my previous post (Saturday, 27 November 2010, 06:42 PM) still apply.
Added support for exporting glossary entries as MULTICHOICE questions or SHORTANSWER.
PS.- Trying to beat Itamar in our friendly competition.
Thanks for this feature, Joseph! I am relatively new to Moodle, and I am already in need of this type of tool. I explored the block on your demo site with success. Is there a way to implement it on my course site at present?
Version for Moodle 1.9 is available. Version for Moodle 2.0 available as soon as some tricky new 2.0 features are solved.
English and French interface and help files. Anyone interested in translation to other languages please contact me.
Thanks to all those who helped in the tests.
Joseph I will make the Czech translation.
(Help files will follow)
Version for Moodle 2.0 now available from the Modules and Plugins database Block: Export Glossary to Quiz..
English, French and German lang strings available.
Unfortunately, due to a bug in Moodle 2.0 the online help files & documentation page are unavailable for the M 2.0 version. Please vote for a quick resolution of bugs MDL-26072 and MDL-26064 which concern all blocks in Moodle 2.0
As usual, please report any bugs or remarks in this discussion (rather than in the Modules and Plugins database). This concerns all those currently testing Moodle 2.0.
Joseph, the block download is not available, it has not been approved for download.
This block is a lifesaver for us! We have many vocabulary books in use that we would otherwise have had to create questions for manually.
However, we are only able to create short answer questions. Multichoice does not seem to work.
This screenshot shows the block after configuration, note that question type is set to Multiple Choice. However, as the attached XML file shows, the block exports short answer instead!
(Not important, but: )
I discovered an additional issue while trying to get this to work: sorting order does not matter to us, so initially I just left it at alphabetical. However, trying to see if changing options would help create the right question type, I changed sorting order. However, this option does not save properly. Again, the screenshot above was after I chose "random" as sorting order. It seems that, no matter what sorting order I choose, it reverts to alphabetical.
Thanks trying out the Glossary to Quiz block. I expect you tried it on a moodle 2.0 site, because the problems you describe do not happen in the 1.9 version of the block.
You are correct, there is a bug, I forgot to implement the multichoice question type export in the 2.0 version and will fix that bug (and the sort order bugs as well) ASAP and report here when fixed.
EDIT.- Fixed. Please download latest version and test. Remember to visit Admin/Notifications after upgrading and watch for new version notification (2011012800).
I tried to import one of my glossaries in Moodle 2.0.2 to create a MCQ quiz but got this error when I tried to import the XML file:
Parsing questions from import file.
There are no questions in the import file
Any idea what could have happened there?
Edit: I juxst tried with a smalled glossary (27 items) and it worked. The original one was 127 items. Must have been too much
Here goes the Czech translation, two versions, with/without diacritics.
I imagine you have moved well beyond troubleshooting the "Glossary items used in a quiz" in Moddle 1.9, but I am still having difficulty with it and would appreciate your assistance, if possible.
- Everything seems to go smoothly through section B.5 in your instructions above.
- When I select "upload this file", instead of seeing the questions displayed, I get the following message: "Parsing questions from import file. Importing 0 questions from file." And I can't seem to get beyond this point.
- The Glossary I have exported does contain categories. I have tried exporting "*all entries (105)" [attached as Modern_Dance_Class_Glossary(6).xml"] and separate categories, but I still get the same result.
Thanks in advance for your time in letting me know what I am missing.
An additional note: After configuring the "Export to Glossary Quiz" and saving the changes, I do see the link with the correct number of glossary entries under the "Export to Glossary Quiz" block heading.
The Moodle 2.5 version of block Glossary export to quiz is now available from the Moodle plugins database https://moodle.org/plugins/view.php?plugin=block_glossary_export_to_quiz
Non-English languages users are welcome to contribute to the translation of this add-on on AMOS. So far the following translations are available: French (complete), German (incomplete), Czech (incomplete).
A complete documentation (in English) is available in the Moodle Documentation Wiki here: http://docs.moodle.org/25/en/block/glossary_export_to_quiz/edit
New version 2.5.1 (for Moodle 2.5) of block Glossary export to quiz is now available from the Moodle plugins database https://moodle.org/plugins/view.php?plugin=block_glossary_export_to_quiz
No changes to the interface but I finally managed to make my code 100% compliant with the Moodle Coding style recommendations.
Debug info: ERROR: argument of AND must be type boolean, not type smallint
LINE 1: ..._glossary_entries ge WHERE ge.glossaryid = 1 AND ge.approve...
SELECT * FROM mdl_glossary_entries ge WHERE ge.glossaryid = 1 AND ge.approved ORDER BY concept ASC
)] Error code: dmlreadexception
Stack trace: line 423 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 248 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 753 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 125 of /blocks/glossary_export_to_quiz/exportfile_to_quiz.php: call to pgsql_native_moodle_database->get_records_sql()
I am using the latest (as of 8/30) version of moodle and of this plugin. Moodle 2.5.1+ (Build: 20130823) Export Quiz to Glossary build 2013060900
Daniel " It is probably because I am using a PostgreSQL database rather than a MySQL database."
That may well be the case. I need to re-install a PostgreSQL dabase on my local test site to find out and find a fix. But I'm going to be away from my base for a few days, so this will have to wait. Do message me if I forget!
Well after a few days of testing I'm glad to say that both the convertors work for me like a charm. The database solution is a little bit more difficult to set up, but it adds its value due to the multiple choice option.
Thank you bot very much, my students will now learn to be much more careful and precise when entering the glossary entries