Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
回帖数:39
Hi all

I had to develop a little tool for work and decided to upload it with a little manual to give something back to the Moodle Community.
Basically, it allows you to prepare Short Answer and/or Multiple Choice questions in Excel and then export the same questions in the two formats.
Of course, you can use it for one format only, but this way students can practise the same subject in two different ways.

It works fine now, although there may be some bugs (but I do think I got them all). Feel free to use, distribute or modify it as you need.
If you encounter bugs, please post them here and I'll have a look.

Hope it'll be useful to others!

-----------------
Here's the background:

At our language institute, we wanted to create vocabulary exercises that could be both "receptive" and "productive": in a first stage, the student would practise with MC questions (more "receptive" and then when he feels confident enough, switch to "productive" mode with short answer questions. So the same input should be exported as both Short Answer and MC question...
After some looking around, I couldn't find a gift import template that fitted our needs (we needed support for all feedbacks as well as some formatting of the text) and decided to start from David Fountain's MoodleGlossary Import to get our customised tool... Took me a good week but I think I got it, so here it is. The hardest part was probably to detect the possible errors and prevent users from entering invalid data for grades or leave important fields empty (wanted to make it user-friendly for non-experienced users).



平均分:Useful (2)
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
New, more comprehensive version (Matching & True/False also supported)

here: http://moodle.org/mod/glossary/view.php?id=2741&mode=entry&hook=8061
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Dave Murray -

Hi Jean-Luc.
Thanks a lot and you've clearly put a lot of work into making this.
In particular, the ability to make multi-choice questions without the abc numbering was most appreciated and will be a real timesaver for my current needs.
Dave

回复Dave Murray

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
You're welcome! smile Glad you can use it... Let me know if you encounter any bug or if you have suggestions..
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
Another bug fixed in the latest version (1.3.1)
Details and latest version here:

http://moodle.org/mod/glossary/view.php?id=2741&mode=entry&hook=8061
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

senthil kumar -
Excellent template.

could you please suggest, how to add a new field prior to the Question Name field in Excel template?

Example:
<question type="multichoice">
<tag>
<text>Accounts</text>
</tag>
<name><text>Question Name</text>
</name>
.
.
.
</question>
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

sebastien nivet -

Hi Jean Luc,

thanks a lot for your template.

I' m using Moodle version 1.9.6, and I had trouble importing the file in Moodle.I 'm supposed to import a thoudands of questions, and your display via excel would help me a lot!

If you have any suggestion to make it work, it would be great!

thanks,

Sébastien

回复sebastien nivet

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

sebastien nivet -

Problem solved, but is it possible to add a file to a question (annex).I know it is on Moodle, but is there the option in XL?

Thanks,

Sébastien

回复sebastien nivet

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
There's no provision in the current XML import for additional files, no. You can include a picture base-64 encoded but that's all.
回复sebastien nivet

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
Hi,

sorry, completely lost track of this discussion.
Sorry, I haven't considered files, not, like Howard said, because they are not supported in XML, as I did not know that, but that I did not really have use for it at that time.

What I do when I need files, more specifically sound files, is I upload them first, then play around with html code so that the question text - or answers, or MCQ - have a hyperlink to the file. For multiple questions, I use the concatenate function...

A tad hard to explain in a few words, also because it depends on what you are looking for, your configuration...
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Bas Brands -
Core developers的头像 Peer reviewers的头像 Plugin developers的头像 Plugins guardians的头像 Testers的头像
Hi Jean-Luc,

Thanks for your excellent template. I have used it to transfer questions from from educatienet to Moodle. We will now manage our questions in your xls and upload it to moodle when we change a range of questions.
I have modified it to enable multiple categories and with a small hack in Moodle I was able to use only update changed questions.
We are now looking for a way of adding more than 250 questions. Do you think this can be done?

Thanks!
回复Bas Brands

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -
wow.. Completely forgot to check on this.. Don't know if this answer will still be helpful.

Yes, over 250 questions can certainly be done... But... I'd have to dive back in it and just don't have time for that now... Sorry. Could only suggest to use multiple files.

I'm interested in your mod, for the categories. Could you send me a copy? (pm)


回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Daniel Corunna -
I've tried using your excel file in Office 2008 (Mac Version) and seems like the macro is not there, even though I have opened the file to run the macros.

Is there any workarounds to help me out?
回复Daniel Corunna

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Ralf Hilgenstock -
Core developers的头像 Particularly helpful Moodlers的头像 Translators的头像
I did it with Office 2007 (win) in this way.

  1. Start Excel file and allow macros
  2. Save as Excel/macro file
  3. Start new file with macros
Maybe this will work with Mac also.
回复Daniel Corunna

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Eoin Campbell -
Core developers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像
Excel 2008 for the Mac does not provide any support for Visual Basic for Applications, so the macros, which are written in VBA, will not work.
cf. http://en.wikipedia.org/wiki/Microsoft_Office_2008_for_Mac#Features

You could try using Office on Windows, or else use Excel 2004 for the Mac, which does support VBA.
You could also run a Windows emulator on your Mac and install the Windows version of Excel 2003/7.

Apparently, the next release of Office for the Mac (2012) will support VBA again.
回复Eoin Campbell

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Majid Hussain -
: Is it possible to use a macro enabled excel spreadsheet in Moodle?
回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -

a new version of the Excel to Moodle XML question exporter is available.
You can now add hints for the questions and the choices, using automatically generated <cite> tags. More info in the manual.

It's still not optimised for Moodle 2.0 as we have not upgrade yet, and I haven't been able to look further into that, but I hope to be able to do that soon...

Two available files: Office 2010 and Office 2003 (haven't tested that one though)

You can download them here:

http://moodle.org/mod/glossary/view.php?id=2741&mode=entry&hook=8061

回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -

seems like the entry is hidden and I can't change that? Can anyone confirm they have access to the entry to download last versions of the files?

回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jürg Hoerner -

sorry I cant download the file. Ther is no entery I can see.

Can ou add it as attachment?

回复Jürg Hoerner

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

It is the old problem where when one of these downloads is edited, it disappears until a moderator re-approves it. I don't have permission to do that, but I am sure someone will deal with it soon.

回复Tim Hunt

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -

ok thanks, we'll just wait for that 微笑 I can't attach it here as size here is limited to 100K and the zip file's bigger than that... in the meantime you can get it here (I'll remove it from there once the entry's approved again)

回复Jean-Luc Delghust

Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Jean-Luc Delghust -

Ok, as the entry in the exchange course remains hidden for some reason, and just to summarise the system, I'm adding a longer post to the thread.

For those who just want the latest version, here are the DL links:

Download links:
version 2.0.1
version 2.0.1 with possibility to import from 1.3.4 (see below)

I'll probably have to move them soon...If so, I'll add a post with the new links.

Those files are intended to create questions in Excel and export them as Moodle.XML format. I added the possibility to add hints in version 2.0, and fix a stupid bug for shuffle answer default value in 2.0.1...

As some colleagues had done quite a lot of questions this way and had kept the Excel files, I've made a different version that makes it possible to import questions from a version 1.3.x of the excel file, so you can add hints without having to copy/paste all the info.

Here are a few features, more details in the manual in the zip file:
- Supports Multiple Choice, Short Answer, Matching, Ordering and True/False
- Up to 250 questions per question type, up to 10 answers for MC & SA, 20 for matching, 25 items for Ordering.
- Supports HTML in Question Text and all Feedback cells.
- Easily convert Multiple Choice questions in Short Answer questions and the other way around.
- Supports non-English characters and excel line breaks (true UTF-8 export)
- Possibility to automatically add <nolink> tags to prevent auto-linking to glossaries in quizzes.
- Define grades
- Before export, all questions are checked for errors (grades, question name, etc... ) to ensure Moodle compatibility. Errors are explained.
- Manual included
- possibility to add "hints" on the questions (all) and the choices (MC & Matching) (see manual for more info)
- option to hide/unhide feedback & hint fields if you don't want to use them.

I'll try and keep an eye on the thread, so if you have any question/suggestion, or notice any bugs, please post them here.

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Jean-Luc Delghust -

The download links in the previous post are broken as there were some errors in the code. I've spent some time looking into it and here are the newer versions of the spreadsheet. I took more time to test them, and they seem to work fine (but you never know)

Also changed some codes so it runs a little bit faster on the checks.

There are two versions (Excel 2003 & 2010 included in each "package"):

- Simple hints: this version uses the HTML cite tag to add hints to questions and/or choices. The hints will display in a textbox on mouseover.
advantages: no tweaks necessary to the moodle theme. Compatible with most browsers.
disadvantage: no html formatting or line breaks in the hint

Download the Simple Hints version here

- CSS hints: not the best name, I guess, but at least it makes it simple: it uses CSS formatting to display hints.
advantage: (simple) HTML formatting is possible, line breaks, bold, italics... (no links though)
disadvantage: you need to add some info to your theme's CSS. It's all included in the zip-file.
Please note I have only made tests with simple formatting like bold, italics, underline, strikethrough and line breaks.

Download the CSS version here

(Note: should the links be broken, check in the posts below if any, it'd just mean that I had to move the files or updated the file)

This "hint" system has nothing to do with what's in store for the question in Moodle 2.1, of what I've read (and am looking forward to). It's just formatting, so you can't specify a penalty if students access the hints. We only use this for what we call "learning quizzes": students can take those quizzes as many times as they want and use hints and feedback to improve their understanding of the task (mainly reading / listening).

As usual, comments welcome.

I'll also update the entry in the exchange course.

(BTW, if anyone has a good free filesharing system to recommend, so I can upload the files there rather than from our servers - can't attach them here as they're too big)

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Steven Rathbauer -

Hey there, this tool is absolutely fantastic and I love using it.

I have found one bug though.  On the short answer sheet, cell Q3 places a hidden apostrophe at the beginning of the cell in the formula field but it is not visible in the cell itself.  Once exported it also appears within the questions answer.  I can manually look for this each time and delete it but i think it would make more sense to determine whats causing that.

In the mean time I have done something that I think works...I unprotected the short answer and mult choice sheets and copied cells A3-AQ253 on the multiple choice sheet and pasted them over the same cells in the short answer sheet.  Since these two sheets are essentially the exact same thing i figure this should be no issue.  Once complete i re-protected them and saved a new copy.  It seems to have worked but I want to make sure I havent messed anything up.

 

ALSO PS:  Ubuntu offers a new file cloud for free which offers web sharing called Ubuntu One(https://one.ubuntu.com/).  That should work for your needs 微笑

 

Thanks in advance for your help

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Роман Савкив -

Thank you very-very-very much!!!! All is Fine! I have about 11 000 questions in excel and all are in moodle now. Thanks!!!

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Ted Holzmann -

Jean-Luc,

We corresponded a few times in 2010 about a specialized use of this tool. That worked great.

Now I am back again and trying it in our new Moodle 2 site. It works -- so far -- without a hitch.

BUT it will only work off a Windows version of Excel. Others may, like me, attempt to run it off of a Mac version of Excel. When one launches the exporter (in this case I had just one T/F item entered) the following Run-time error (1004) comes up:

Method 'GetSaveAsFilename' of object '_Application' failed.

Running Debug takes you to a line of code that reads:

varFileX=Application.GetSaveAsFilename("MoodleTrueFalseQuestions_Hints_Nolinks.xml",FileFilter:=Moodle Short Answer XML (*.xml),*.xml")

I googled the problem and find that the clearest explanation appears to be here:

http://www.mrexcel.com/forum/showthread.php?t=607081

I don't understand enough to be sure how to implement this in your coding. Perhaps you or another user may be able to extend the useability for Macs!

All the best to you, and thanks again for this amazing tool!

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Erjon B -

The links dont seem to be working, can you reupload them please?

回复Jean-Luc Delghust

Re: Excel to Moodle (SA-MC-Match-Ordering-T/F) - Moodle XML

Alvaro Pineda -

I wasnt able to download the files, is the link broken?

Thank you, the original one is amazing.

回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -

Hi


I have lost track of this discussion. Sorry for the lack of replies/Updates;

Here is a link to a dropbox folder with the latest versions of the file.

https://www.dropbox.com/sh/d85dfvtb4fo3t06/AABuifGGrmsvoLiywEpKmi6qa?dl=0

You'll find

- one zip file with what I called the "simple hints" version

- one zip file with "CSS hints"

PLEASE bear in mind the hints in those 2 versions DO NOT correspond to the hints system in Moodle. Read the manual for more info;

I am currently working on a new version of the file, which exports formatting (bold, italics, underlined, colours), real moodle hints and tags. It's progressing well (SA & MCQ are done) but I still need to work on Matching and TF, update the manual and improve the layout... We have quite a few things to finish at work at the moment so that might have to wait until.. early August (I hope).

I have included the latest development version as is ("°°NewMacro_XLtoMDL_IN_DVT_...). I'll replace it in the folder as I make progress with it; At the moment, only SA and MC work. I have deleted the "without links to glossaries" option as that can now be sorted with filters in the quizzes.

Tags are NOT exported as I get an error when I try to import XL with question tags into Moodle on our production site. 

Feel free to use it, change it.. I have commented the code as much as possible;

HTH

回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Tradejini _ -

Multiple choice Question error

Please help in this


回复Tradejini _

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Jean-Luc Delghust -

sorry for the late reply...


could you send the file to jean-luc.delghust_AT_uclouvain.be?


Haven't had time to work more on the file...

回复Jean-Luc Delghust

Re: Excel to Moodle (Short Answers & Multiple Choice) - Moodle XML

Robin Collum -

Thank you very, very much for this tool. I'm using it for the first time (moodle 2.9+) and have had no problems so far. The documentation has been very clear.

Cheers!