Dear Mary,
thanks for moving the post. I also checked the documentation of Google API and found that the API is able convert txt to pdf. I don't want to use unoconv as AL Rachels propose , because it needs special installation and this is not possible for some clients. I use it on some of our servers... but long story short.
I edited the file
files/converter/googledrive/classes/converter.php
and edited the converter class. I added the txt extension
private static $imports = [
'doc' => 'application/vnd.google-apps.document',
'docx' => 'application/vnd.google-apps.document',
'rtf' => 'application/vnd.google-apps.document',
'xls' => 'application/vnd.google-apps.spreadsheet',
'xlsx' => 'application/vnd.google-apps.spreadsheet',
'ppt' => 'application/vnd.google-apps.presentation',
'pptx' => 'application/vnd.google-apps.presentation',
'txt' => 'application/vnd.google-apps.document'
];
and also added txt in the array of get_supported_conversions(), line 269
public function get_supported_conversions() {
return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf', 'txt']);
}
I disabled the unoconv plugin and tried to grade online text assignment. It works like a charm. The google converter is converting now also this type of assignment to PDF.
I created an issue in the tracker MDL-60319