Feedback XML import/export utf8/ansi

Feedback XML import/export utf8/ansi

by Miro Babinsky -
Number of replies: 7

Dear all,

I am trying to generate xml feedback file with quistions on my computer and with Feedback/Templates/Import questionsand to upload it into Moodle feedback. It is working but with following problem:

I found out that when I import  moodle ffedback genereted xml, it has the first line ... encoding="UTF-8"?> but it is an ANSI file. I have also to generate ANSI file to upload it into feedback without problems (otherwise I will get feedback/cannotloadxml or database problem message)

My question is:

I am using Moodle 2 on KeyToSchool ,  MySQL is UTF-8 Unicode (utf8) encoded what I see in PHP admin. Is there some settings specially for feedback or for the site administration which will allow me to uload files in UTF8? Or is the problem somewhere else?

Thanks

Average of ratings: -
In reply to Miro Babinsky

Re: Feedback XML import/export utf8/ansi

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi,

can you attache a sample file. I do not understand what is your problem.

Andreas

In reply to Andreas Grabs

Re: Feedback XML import/export utf8/ansi

by Miro Babinsky -

2 files with same content, one ansi other utf8 coded which I am trying to import to feedback (Feedback/Templates/Import questions) are attached:
MoodleFeedback_NolinkOK2Ansi.xml - working
MoodleFeedback_NolinkOK2UTF8NotWorking.xml - feedback/cannotloadxml error

In reply to Miro Babinsky

Re: Feedback XML import/export utf8/ansi

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Miro,

you UTF-8 file has a special signature at the beginning called BOM (Byte Order Mark). Some editors can show this but not all (see the screenshot).

Most web-applications I know has problems with this. I don't know what tool do you use to create the xml-files. In any case you have to ensure that the file is saved in utf-8 without BOM.

I am hoping it helps a bit.

Andreas

Attachment feedback-xml.jpg
In reply to Andreas Grabs

Re: Feedback XML import/export utf8/ansi

by Miro Babinsky -

Dear Andreas,

thank you. I was designing convertor between Excel and Feedback. Now it works. I am attaching it.


Here are my notes to it:
ExceltoFeedbackXML (and back) fisrt version 24.June 2011 - check for updates
Allow macros first
Should work for Excel 1997,2007,2010 - not tested if language independent
Opensource - any comments welcome
Use at own risk - no checking - work on copies
Based on:Quiz to XML: Jean Luc: http://moodle.org/mod/glossary/view.php?id=2741&mode=entry&hook=8061 and  http://sites.uclouvain.be/moodle/file.php/1/QuizXLMoodleXML/QuizXLtoMoodleXML.V.2.1-SimpleHints.zip
Excel to glosary: David Fountain: http://moodle.org/mod/forum/discuss.php?d=79120
Export and import (just import feedback.xml with excel as a table)
XMLT will be final solution but some features (join columns) maybe useful

BR Miro

In reply to Miro Babinsky

Re: Feedback XML import/export utf8/ansi

by Miro Babinsky -

I am sorry for multiple posting. It is not easy to make it working in multiple versions of Excel. I put actual version here, to be able to upgrade it:

https://sites.google.com/a/webuniverzita.com/exceltofeedbackxml/download/BabinskyExcelToFeedback.xls

In reply to Miro Babinsky

Re: Feedback XML import/export utf8/ansi

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Miro,

thank you very much!
The xml-file is created very well.
I tried to use the button "Split into seperate columns" but it dosen't work. There comes a message
Laufzeitfehler '438'
Objekt unterstützt diese Eigenschaft oder Methode nicht

After Click on "Debug" it jumps to the line:
Selection.ListObject.ListColumns.Add (PoradoveCisloStlpcaPresentation + i)

Best regards
Andreas

In reply to Andreas Grabs

Re: Feedback XML import/export utf8/ansi

by Miro Babinsky -

Hi Andreas,

THank you for support. It does not work with my example file or with your file? Problem may be related to version of Excel or the language. In my example, after click on Split..  three new columns should be created with default names column1, 2, 3 in the local language like:

Send me the file please if it is your file or if it do not work with my file I will need version of excel you use to repeat it or  values of PoradoveCisloStlpcaPresentation and i.

BTW: Moodle module Quiz can import UTF8 files also with BOM.

Best regards

Miro