I found that I had a big problem when importing question stems that had apostrophes. The importer displayed strange characters where the apostrophes were (but the right number of questions were imported), and then in the question preview, the question strings were truncated at the point where the apostrophe occured.
My question is, should we put the question strings in quotes?
Or is there a bug in the importer?
How shall I make sure that my instructors do not lose parts of their question stems?
I was going to try aiken and see if that worked any better, but I wanted to ask this question in the meantime.
I am using Moodle 1.6.1 from about July 25.
Thanks for any help!
The sympton is that bits of text get cut off at the first 'special' character.
Can you post one of you GIFT files that demonstrates the problem. That would help us investigate.
Here is the offending file. I think there are about 3 questions that have an apostrophe. We could reword to avoid apostrophes, but occaisionally that would be very awkward. Example: Surgeon General's Report. That is really what it is called, and the Report of the Surgeon General is just NOT the same thing!
Thank you guys for your help.
In your chapter1.txt file, just replace all apostrophes with their HTML entity: ’
However, I hope Tim or someone will find a fix for this bug... Moving Moodle to UTF-8 was supposed making dealing with special characters easier, not more difficult.
Just to be sure - how is your GIFT file encoded? Are you using non-latin1 characters, or anything like that??
I have tested in 1.5 and 1.6 just to make sure.
Please see the attached image - this is what it looked like on my editor (I tried it in more than one editor too - no different).
I'm checking out the special character truncation thing - but that's not really the problem you were having.
Do you think it has something to do with excel? I had copied and pasted the output into notepad, then uploaded the .txt file.
Well, thank you for the hints. I will keep digging at it!
edit: Additional thought. You know, the original text was in a Word file (the test bank provided by the publisher ONLY outputs to word or a proprietary format, so we were using the gift creator to try to get an importable file). We copied the question stems from word to excel, then got the concatenated output and put it in notepad. Perhaps the special characters were transfered from the office stage of the process? You never know about MS Word. . . .
I am not in a position to try this out I'm afraid. I don't currently have access to a Windows machine (happy Mac user ), and the Excel to Gift stuff doesn't work in the Mac version of Excel.
You may have to do a bit of research, as to where it is coming unstuck!
I saved some text from both Excel and Word with apostrophes to text files and no odd behaviour at all.
Possibly something has been fixed recently.
Exactly, that's why I suggested replacing them with HTML entities, which does solve the problem (pending further fixes)...
its not only a problem with GIFT, you have the same situation with user bulkuploads ....
In an NON UTF_8 PC environment and MS-Office ... do you have to copy exported files in notepad2, change to utf_8, save it and then import this? You cant save from Excel or Word as an UTF_8 File ...or?
Or is there another more handsome way to do so,
thanks for hints!
p.s.: in config.php there is still from 1.5
$CFG->CSV_DELIMITER = ";";
$CFG->CSV_ENCODE = "59";
to translate "," to ";" for uploads ...
There was some discussion around this topic - we came close to having an option for the encoding of input files (in quiz importing at least) but decided against it. For one thing there are millions of the things, and the list depends somewhat on your environment and what libraries you have available. Secondly, we thought that if you usually use non-latin encodings you would be familiar with editing in and/or converting to utf-8. A dreadful cop-out I know
Thanks for your answer, sometimes its a problem not to be an english nativspeaker and not a mac user ...
We will try to find a handsome workaround with an description and with downloadlinks, because most of the users have an idea what utf_8 could be ...
Here is one solution:
Use Notepad2, http://moodle.org/mod/forum/discuss.php?d=51569 BUT dont convert with datas in it (you may loose conversations!) , first change a blank form to UTF-8 THEN copy the text in notepad2 THEN save as UTF-8
Its just a workarround, but helps
DONT use windows notepad and save as UTF-8, because then a unknown sign will be in the first line - this raises problems when bulkuploading users with csv...
"copy exported files in notepad2, change to utf_8, save it and then import this?"
I am lost. I have not a clue about how to change a file to utf_8.
So I will try this and see if it solves our problem!
edit: yes, worked like a charm.
What a strange thing!
Creating new tests with notepad2 and GIFT seems like a very workable sollution, but I have loads of tests (should be over 2500 questions) with apostrophy problems in Moodle already (yes, some teachers prefer to use Word to produce text documents ).
In IE I get a square and FF just ignores the apostrophy and shows nothing (like jai instead of j'ai)
Running Moodle 1.6.2 with migrated database (updated a minute ago ).
Any suggestions how to solve this ?
Word is trying to pretty up your text by replacing
apostrophe with open single quote and close single quote. Of course that means guessing which is which. Predictably it does an imperfect job.