2) If you save the xls file to your hard disc, then open it in a text editor, you will probably see a PHP error message. If you tell us the error message, we are more likely to be able to help.
Attached is the excel file.
Re: Problems with Item Analysis downloading into Excel


- as Steven said, I don't see any error in the file's content with notepad, must be something else ...
- can other Moodle users of 1.6.2+ and 1.7 versions test to see if the download is working on their websites (no need to test for olders Moodle versions)
- Tim, has any change been made to this feature recently ? All reports were originally using very similar code for the download version (Enrique Castro is the original author of the Item analysis download to Excel code, but I have somewhat modified it in the past, and used it as a source of inspiration when I wrote the download to Excel code for the other reports)
- I will study the problem as soon as I can but I don't think I will be able to look at it before next week-end
Re: Problems with Item Analysis downloading into Excel
Some of the database code was touched in 1.7dev to make it work on MSSQL and Oracle, but that does not affect Moodle 1.6.
We are, of course, using an Excel export library, and I don't know if they updated the version of that. I didn't see it happen.
Or Microsoft might have issued an Office update, but I doubt that would change the file format.
I'm baffled.
It is not the end of the world, since Excel happily opens CSV or tab delimited files, which you can also export.
But if anyone has a chance to investigate this furter, I would be most grateful.
There is obviously something wrong with the Excel export in latest updated Moodle 1.6.2+ (just updated today, Oct. 4th).
I am getting exactly the same error message as mentioned by Steven (in French):
Journal de réparation de fichiers Microsoft Office Excel
Des erreurs ont été détectées dans le fichier 'C:\DOCUME~1\Joseph\LOCALS~1\Temp\AM1SE_Freedman_Oral_Comprehension.xls'
Liste des réparations :
Le fichier était trop endommagé pour pouvoir être réparé. Excel a essayé de récupérer vos formules et valeurs, mais certaines données ont peut-être été perdues ou endommagées.
In fact, I am also getting the same error when trying to import as an Excel file a Grades table!
On the other hand, as Tims says, the text format still works and can be imported into Excel.
Joseph
..or is it again the headerinformation that does not support IE?
The studentlist-pdf from University of Florence has a fpdf.lib version that discriminates between IE and not IE browsers and sends different headers, works for me. (type florence in the forums to find it..)
I understand that is has soemthing to do with the PHP version..
We now have php 4.4.4 and iconv 2.3.5 and.. Excel works now fine for grades, but not for quiz reports.
I understand that is has soemthing to do with the PHP version..
We now have php 4.4.4 and iconv 2.3.5 and.. Excel works now fine for grades, but not for quiz reports.
Re: Problems with Item Analysis downloading into Excel
Since I upgraded my production website 2 weeks ago for Moodle 1.63 + to Moodle 1.7+, I am having problem in all Excel daownloads (not only the quiz module but also the gradebook). I made a lot of tests and I am nearly convinced that
- the problem isn't in the quiz module (or the gradebook)'s code but in the Excel library
- people using only US characters may not see the problem as all Excel downloads containing only ascii 0-127 characters were always OK in my tests (If anybody noted the problem in a test containing only ascii 0-127 characters, please contact me)
- maybe it has something to do with characters translation to UTF-16LE and the libraries iconv and mbstring used for that translation (but I am not 100% sure of that ...)
- In my particular case as my hosting compagny (totalchoice) has only mbstring installed and not iconv this may be part of the problem
This works well for gradebook or the overview report but is less than ideal for item analysis and detailed responses
Re: Problems with Item Analysis downloading into Excel
What excel library are we using? Is there a more up-to-date version of it that the one we are curretnly using, which copes with UTF-8 better?
Now we know what is going on, this should be fixable.
Re: Problems with Item Analysis downloading into Excel
i get a similar error message.
Judith Rutschman
Re: Problems with Item Analysis downloading into Excel
I get the same error message but only when I try and download ALL participants (144 student results in my most recent download) to an Excel file. If I split the participants into class groups and download each separately there is no problem. It looks as though approximately the first 100-120 are OK but the others have missing names and/or result total. Is there a problem with file size perhaps ?
Attempting a bit of a debug, I tried re-ordering the SQL query to see if it was always the same entries that got corrupted : it wasn't. Nor was it the entries on lines always on X,Y or Z.
To save my users having to download the text file, rename it to a .csv file and opening it again in Excel I did the following nasty hack:
Change:
elseif ($download=='CSV') {
$filename .= ".txt"
To:
elseif ($download=='CSV') {
$filename .= ".csv"
Re: Problems with Item Analysis downloading into Excel
Can all Moodle users having some problems with Excel downloads post here :
- the version of PHP their server is using
- if PHP was compiled with iconv enabled (if I remember well, iconv is installed by default for PHP versions > 5.0)
- if PHP was compiled with mbstring option enabled
<?php
if (!function_exists('iconv')) {
echo 'iconv is not installed';
}
if (!function_exists('mb_strlen')) {
echo 'mbstring is not installed';
}
?>
Re: Problems with Item Analysis downloading into Excel
my PHP version is 4.4.4
iconv is not installed
mbstring is installed
I have problems with Excel downloads both in quiz reports and in gradebook but not always, some downloads are OK. The only pattern I was able to find is that all downloads without any french accented characters are OK but I don't have quiz with a lot of attempts in that case.
Re: Problems with Item Analysis downloading into Excel
iconv installed
mbstring installed
(Moodle 1.6.1)
By the way, you don't need Jean-Michels script of you have access to the moodle admin area: there's an 'Environment' link at the bottom that tells you this information.
Re: Problems with Item Analysis downloading into Excel
Our regular system:
php 4.3.11
iconv OK
mbstring OK
Moodle 1.6.1
Also a trial system:
php 4.3.11
iconv OK
mbstring OK
Moodle 1.7
Item analysis exports straight to Excel (2002) fine on both. Hope this helps.
Re: Problems with Item Analysis downloading into Excel
in the lib/excellib.class.php file, comment the 2 lines
// $this->pear_excel_workbook->setVersion(8);
and
// $str = $textlib->convert($str, current_charset(), 'utf-16le');
all downloads appear to be OK now.
The only drawback of this method is that all special chars are left utf-8 encoded and are not recognized as such by Excel some for instance é become é, ... but as I already have a macro to convert such characters, it will works for me until we find a better way.