It seems that Google Sheets get imported as xlsx documents, but Google Docs get imported as rtf files.
Any help greatly appreciated.
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:
$title = $item['title'] . '.docx';
$exportType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
The available conversions are documented here: https://developers.google.com/drive/web/manage-downloads#downloading_google_documents.
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.
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.