A "bug" after the questions import....

A "bug" after the questions import....

by C P -
Number of replies: 14
Hello everyone,

I'm using Moodle 1.9.4+ (Build: 20090429).
When I try to import some multiple choices questions from the GIFT format, the first question is not imported and of course doesn't appear in the quiz.
This bug only appears when all the questions are of the same kind (for example : only multiple choice, or only true/false).
But if the first question isn't of the same kind as the others, it works...

Any idea ?

Thanks sourire
Average of ratings: -
In reply to C P

Re: A "bug" after the questions import....

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Almost certainly the editor you are using. Some break the files by adding a thing called a BOM at the beginning. Quick fix... use (specifically, save with) a different text editor.
In reply to Howard Miller

Re: A "bug" after the questions import....

by C P -
I saw the editor needs to use UTF-8 format, that's why I'm using Notepad++.
Is it possible to use the Notepad included in Windows and make it use UTF-8 ?
In reply to C P

Re: A "bug" after the questions import....

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
Do you have an empty line between each question ?
In reply to Nadav Kavalerchik

Re: A "bug" after the questions import....

by C P -
Yes there is an empty line between each question.
The questions are made in one line. (1 line for each)
In reply to C P

Re: A "bug" after the questions import....

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Christophe,
The easiest way for us to help you is for you to attach your MCQ GIFT import file to your post so we can examine it.wink
Joseph
In reply to Joseph Rézeau

Re: A "bug" after the questions import....

by C P -
I'm trying to resolve the problem found by a user of the blackboard, so I'll ask him to give me the file. As soon as I get it, I'll share it. Thanks
In reply to Joseph Rézeau

Re: A "bug" after the questions import....

by C P -
Here is the test file smile
In reply to C P

Re: A "bug" after the questions import....

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Christophe,

Your GIFT test file was encoded as UTF-8(BOM), which causes problems upon importing into Moodle.

Using one of the many "advanced" text editors available on the Internet, (the excellent UniRed), I was able to a) detect your BOM encoding and save it with a new UTF-8 (non BOM). I am attaching the correct file.

It would have been easier to understand your sample file if not all the questions had been exactly the same.wink

Joseph

PS.- For more info about that silly UTF-8(BOM) problem, see Problems with Swedes: Uploading users via text/csv and also Display problems caused by the UTF-8 BOM

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: A "bug" after the questions import....

by C P -
I'll try it too. Thanks !
In reply to Joseph Rézeau

Re: A "bug" after the questions import....

by C P -
Any hint ??
In reply to C P

Re: A "bug" after the questions import....

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
i think it is because you are using a Windows file format.
the file you attached uses "END OF LINE" Windows format.
it should not.

do you use Notepad++ ? it has UNIX file format feature as well as UNICODE (UTF-8) encoding. both, are needed to be set if you are uploading text files into Moodle.

i am attaching a working example.

btw, your GIFT format is fine. as far as i can tell (tested on Moodle 1.9.4)

smile
In reply to Nadav Kavalerchik

Re: A "bug" after the questions import....

by C P -
Yes I use Notepad++, i'll try to set it to UNIX format.

I'll give a feeback soon.

Thanks a lot !