Google Repository - Docs

Google Repository - Docs

by Matthew Orlando -
Number of replies: 3
Is there a way to set it so documents imported from the Google Docs repository come in as Word documents?

It seems that Google Sheets get imported as xlsx documents, but Google Docs get imported as rtf files.

Any help greatly appreciated.

Moodle 2.9.1.


Average of ratings: -
In reply to Matthew Orlando

Re: Google Repository - Docs

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Matthew,
that is by design, in the core code.

If you want to change that behavior you need to change some core code lines starting from https://github.com/moodle/moodle/blob/c79054288544c02e65a9f2afe7be6c40ea21d11d/repository/googledocs/lib.php#L348:

                        case 'document':
                            $title = $item['title'] . '.docx';
                            $exportType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
                            break;

The available conversions are documented here: https://developers.google.com/drive/web/manage-downloads#downloading_google_documents.

HTH,
Matteo

Average of ratings: Useful (2)
In reply to Matteo Scaramuccia

Re: Google Repository - Docs

by Matthew Orlando -

Wish I had seen this sooner...for some reason I didn't get email notification that this was responded to.


In any case, this is very useful, thank you.


I wonder, however, why the choice was made to make documents rtf files, but presentations come over as pptx and spreadsheets come over as xlsx files. Seems strange that you'd choose the Microsoft format for 2 types, but not for the third.

In reply to Matthew Orlando

Re: Google Repository - Docs

by Rob Johnson -

I hacked the repository to return PDF instead of rtf or docx.  This way student submission to Assignment can be used with the annotation tool.  My hunch is rtf was chosen for folks on older MS Word versions.