No report downloading

No report downloading

by Jay Melton -
Number of replies: 25
Hello all:

I've just run a quiz and everything went fine. However, in trying to download the data in Excel format, I get no file. I can get a text version, but the layout of the Excel version uses the sheets for each section of the results. Is there something I need to check or tweak to get the Excel file?

Jay
Average of ratings: -
In reply to Jay Melton

Re: No report downloading

by Thomas Robb -
Jay,

Can you get the results on the screen? Do you get any error messages at all? Does the download function work with other, perhaps shorter quizzes?

Also, what kind of system are you running Moodle on?
In reply to Thomas Robb

Re: No report downloading

by Jay Melton -
Hey Tom (long time, no communicate!),

Yes, I get results on the screen. No error messages. I've only run the one quiz, so I can't compare (sorry), but I did run the same quiz on another installation (at another completely different site) with no problems getting the Excel data. Both installations are moodle 1.2.1, and the one I'm having troubles on is on Mac OS X 10.3.3 in my office (the other installation is on a hosted board, linux, I think). Mysql is 3.x, php is 4.x.

If I use Safari to download the Excel file, I see the download page just scrolling by, but nothing downloads. If I use Netscape, I get a file, but it's void of data...

Jay
In reply to Jay Melton

Re: No report downloading

by Aaldrik Steenhuis -
The same problem nearby , I get an excelsheet with next content:
<br />
<b>Fatal error</b>:  Cannot instantiate non-existent class:  format in <b>c:\easyphp1-7\www\moodle\lib\excel\Workbook.php</b> on line <b>67</b><br />
In reply to Aaldrik Steenhuis

Re: No report downloading

by Zbigniew Fiedorowicz -
I believe this may be due to a bug in Moodle. See http://moodle.org/mod/forum/discuss.php?d=7037&parent=33381

If my hypothesis is correct, you should be able to fix your problem by editing the file
c:\easyphp1-7\www\moodle\lib\excel\Workbook.php as follows:

replace the line

require_once('Format.php');

by

require_once("$CFG->libdir/excel/Format.php");

Let me know either if this fixes your problem or not.  If it does, I'll put the fix in the CVS.
Average of ratings: Useful (1)
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Jay Melton -
That was it! Thank you, thank you, thank you!

I got the files with no problem now.

You da' man!

Now, should I make the same change with the other installation as well, or should I leave it (it works as it is)?

Jay
In reply to Jay Melton

Re: No report downloading

by Zbigniew Fiedorowicz -
Glad to hear it works.  It is now in the Moodle CVS.  As for other installations, are they running on Macintosh or Windows servers?  If they are, then you should apply this patch on them also. If they are running on Linux (or other Unix-like OSs) servers then this bug doesn't affect them.
In reply to Jay Melton

Re: No report downloading

by Don Hinkelman -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jay and Tom,
I also use OX X 10.3.3 so decided to check this out. I found the same results as Jay. In a quiz, the detailed statistics show nicely on screen. In Mozilla browser, when I click on Save as Excel, processes starts but the end result is an excel file of zero KB. Same results with either quizzes with either 50 or 300 attempts.  Text file format seems to download OK. I tried this process also on Safari, but there in my download manager window, the report.php script just hung and ran continuously.
In reply to Don Hinkelman

Re: No report downloading

by Zbigniew Fiedorowicz -
Try my suggestion: http://moodle.org/mod/forum/discuss.php?d=7079&parent=33384

Let me know if it works.
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Aaldrik Steenhuis -

Hallo thanks for your help.

I get this:

<br />
<b>Parse error</b>:  parse error, unexpected T_REQUIRE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>c:\easyphp1-7\www\moodle\lib\excel\Workbook.php</b> on line <b>99</b><br />
<br />
<b>Fatal error</b>:  Cannot instantiate non-existent class:  workbook in <b>c:\easyphp1-7\www\moodle\mod\quiz\report\fullstat\report.php</b> on line <b>306</b><br />
Afther changes in Workbook.php
In reply to Aaldrik Steenhuis

Re: No report downloading

by Zbigniew Fiedorowicz -
The error message is now refering to a different line 99 in Workbook.php, which should be a blank line.  What did you use to edit the file?  You should use a plain text editor like Notepad, not a word processor like Word or WordPad.
In reply to Aaldrik Steenhuis

Re: No report downloading

by Zbigniew Fiedorowicz -
You can download the modified file from the CVS by clicking on the following link:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/moodle/moodle/lib/excel/Workbook.php?rev=1.2
[Martin told me to go ahead and make the change.]
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Peter Sereinigg -

Hi,

the same problem, but not fixed ..(I updated workbook.php)

textfile is ok

excel -> nothing

The Error message: "Error when copping the file" and "Cant read source ..."

Downloading grades works without problems ...

(1.3 latest nightly)

Thanks Peter

Attachment MWSnap150_2004-04-15_21_00_28.jpg
In reply to Peter Sereinigg

Re: No report downloading

by Zbigniew Fiedorowicz -
I  think you have a different problem. [I don't know what it is.]  The problem which I am attempting to fix now occurs only on Windows and Macintosh servers.  You have a Linux server, if I remember correctly?
In reply to Peter Sereinigg

Re: No report downloading

by Zbigniew Fiedorowicz -
What happens if you try it with Mozilla and tell it to save the file to disk?
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Peter Sereinigg -

Hi,

1.) you are right, I use a unix server

2.) I will download mozilla und try it, you will get the report

Peter

In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Peter Sereinigg -
Wondering,
  • with mozilla it works without problems (PERFECT possibiilties for analysing results, congratulations!)
  • wie IE (latest batch) and Excel 2003 /german
    no result, it seams to be a problem with the tmp dir from ie ..., because also saving it to file does not work
  • But in grades it works with excel and ie (as a hint!)
Happy weekend for you!
Peter

In reply to Peter Sereinigg

Re: No report downloading

by Zbigniew Fiedorowicz -
It looks like there are typographical errors in the code of mod/quiz/report/fullstat/report.php and mod/quiz/report/simplestat/report.php in the line:
header("Content-Disposition: attachment; filename=$course->shortname ".$quiz->name.".xls" );
This header requests that the browser store the downloaded Excel spreadsheet in a file whose name contains a space. I think this may be confusing IE and leading to your error. Try changing that line to
header("Content-Disposition: attachment; filename=$course->shortname".$quiz->name.".xls" );
that is delete the space after shortname.

I don't know if this is really the problem, since downloading Excel quiz reports does not give me this error with IE on my WinXP machine. However IE is quirky, mysterious and inconsistent, so this doesn't necessarily rule out the possibility that this is the cause of your error.

Another possibility is that there are strange characters in the shortname of the course where this error occurs, but this would also cause a similar error when downloading an Excel spreadsheet from the grades page of that course.
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Peter Sereinigg -

I deleted the spaces, but same result.
The course shortname = GMT-JG02-TFB1, this could not be the reason

BUT then I checked the Quiz Name:

  • Aufgabe: Statistische Berechnungen  (Überpruefung)
    First I tried to change the name during saving, no result


    But then I changed this in the quiz configuration to
  • Aufgabe-Statistische Berechnungen - Ueberpruefung

and this works. It is useless to change only the filename when saving, the quizname is the problem ...
I only eliminated the ":" and used again , (Ü) - a German char was not the problem in that case.
I hope this may help to solve the problem.

There are some contributes from me, describing problems with moodle and special chars. If you save an upload with an german special char, the server renames this to "_" and you have to download it by ftp, because the lnk is broken!.
Maybe there is a chance to get an routine, preventing some chars in saving and naming.
It is impossible to do this only with "teachers-law"

Thanks for help, I new now what to to ...
Correcting all Titles ...

Peter

In reply to Peter Sereinigg

Re: No report downloading

by Zbigniew Fiedorowicz -
The colon ":" is not allowed in filenames on Windows or Macintosh file systems.  It looks like the possibility that quiz names might contain unallowed file system characters was overlooked in the report generating code in Moodle.
In reply to Zbigniew Fiedorowicz

Re: No report downloading

by Peter Sereinigg -

My english is not very well,

but I hope this is correct: "you hit the bull's-eye", but why does it work with Mozilla??? 

Maybe there is a possibility to prevent using such names or better change it before using it in the routine?

Peter

In reply to Peter Sereinigg

Re: No report downloading

by Zbigniew Fiedorowicz -
I think Mozilla changes the ":" in the filename to something else while it is downloading.  IE on the other hand downloads the spreadsheet to a temporary file, then tries to rename it to the filename with ":", which generates the "file can't be copied" error.