Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

ved Chris S -
Antal besvarelser: 4

Hi all,

I was just wondering if somebody could please verify my issue with downloading feedback in Moodle 3.1.1. I know that it's now on the 'show responses' tab, however when I select the feedback in Excel format to download, it fails. The error in the console is:

GETHTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier).

All other formats appear to be working correctly however.

If somebody could please verify this, it would be much appreciated.

Thanks, Chris


Gennemsnitsbedømmelse: -
I svar til Chris S

Re: Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

ved Mary Cooch (personal account) -
Billede af Documentation writers Billede af Testers

I just downloaded a feeback file in Excel xls format from our School demo site and I didn't get an error message. Perhaps you'd like to try on one of our demo sites? https://moodle.org/demo/

I svar til Mary Cooch (personal account)

Re: Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

ved Chris S -

Thanks for that Mary. I'd not looked on there but as you say, it appears to be working.

I've been able to replicate this in two WIMP environments so now I'm wondering if it's something going on there. All other formats appear to be working just fine, it's just the Excel output that's causing the problem. Debugging the site hasn't helped either sadly and depending on which browser is used creates a different behaviour. Edge will reload the page, whereas Firefox will just say page cannot be displayed.

Have you any other ideas what this could be? Thanks for your help.

I svar til Chris S

Re: Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

ved Chris S -

Finally managed to locate the problem after digging around. It seems that when it's making the .xlsx temp file, it's not using the standard PHP temp folder but the sys_temp_dir for which I hadn't given IIS access to.

The trace found this: [14-Jul-2016 09:54:50 Europe/London] Default exception handler: Exception - RecursiveDirectoryIterator::__construct(D:\Windows\TEMP/xlsx5787535a313630.44264700,D:\Windows\TEMP/xlsx5787535a313630.44264700): Access is denied. (code: 5) Debug

Do you know why it wouldn't be using the standard PHP temp folder?

This only appears to affect Moodle 3.1 onwards since the move to having the export libraries in the dataformat folder as this worked previously.

I svar til Chris S

Re: Feedback Analysis Excel (.xlsx) download Failure Moodle 3.1.1

ved Chien Wen-chang -
I reported this bug in https://tracker.moodle.org/browse/MDL-56642

I traced source codes of Spout module. I found Spout used sys_get_temp_dir() php builtin function. Windows system default temp directory
is C:\Windows\temp. PHP process lacked list folder permissions in temp directory, so occurred RecursiveDirectoryIterator executing error.
I fixed this problem by adding some lines in \lib\classes\dataformat\spout_base.php are shown below:


    public function send_http_headers() {
        $this->writer = \Box\Spout\Writer\WriterFactory::create($this->spouttype);
        //======================================================
        // added as below
        if( $this->spouttype == 'ods' || $this->spouttype == 'xlsx' )
        {
            global $CFG ;
            $this->writer->setTempFolder( $CFG->dataroot.'/temp/dataformat' );  
        }   
        // =====================================================
        $filename = $this->filename . $this->get_extension();
        $this->writer->openToBrowser($filename);
        if ($this->sheettitle && $this->writer instanceof \Box\Spout\Writer\AbstractMultiSheetsWriter) {
            $sheet = $this->writer->getCurrentSheet();
            $sheet->setName($this->sheettitle);
        }
    }