compilatio / moodle-plagiarism_compilatio

Compilatio.net plagiarism plugin for Moodle
4 stars 9 forks source link

Task send_files fails with external file from Google Drive repository #47

Closed Kemmotar83 closed 1 year ago

Kemmotar83 commented 3 years ago

Hi,

Moodle supports external file from various repositories (ie. Google Drive) and when those are configured to store only links to the external files, in the files table the values saved in the contenthash field are always the same. The task send_files expect to select a unique file from files table and this case always fails.

Here the task log:

Execute scheduled task: Carica i file su Compilatio.net per il rilevamento del plagio (plagiarism_compilatio\task\send_files)
... started 12:35:53. Current memory use 45.1MB.
++ Error: mdb->get_record() found more than one record! ++
* line 1599 of /lib/dml/moodle_database.php: call to debugging()
* line 1155 of /plagiarism/compilatio/lib.php: call to moodle_database->get_record_sql()
* line 55 of /plagiarism/compilatio/classes/task/send_files.php: call to compilatio_send_pending_files()
* line 201 of /lib/cronlib.php: call to plagiarism_compilatio\task\send_files->execute()
* line 119 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
* line 61 of /admin/cli/cron.php: call to cron_run()
no mime type for this file found #77
... used 14 dbqueries
... used 0.19516086578369 seconds
Scheduled task complete: Carica i file su Compilatio.net per il rilevamento del plagio (plagiarism_compilatio\task\send_files)

In order to reproduce the error:

The next send_files task should fail with the previous error.

I'm using the last plugin version and Moodle 3.8 / 3.9.

Thanks, Giorgio

compilatio commented 3 years ago

Hello,

We have tried to reproduce the problem by following your steps, but the files are correctly sent to Compilatio. In mdl_files (and plagiarism_compilatio_files), we see that the contenthash value is not the same depending the file. Although we load twice a file in a assign activity, the two submissions have the same contenthash value, but the files are correctly sent. Can you check you oAuth2 setup and provide us more details please ?

Compilatio team

Kemmotar83 commented 3 years ago

Hi,

that's strange. Have you set External for Supported files and Default return type in Google Drive Repository?

Thank you, Giorgio

compilatio commented 3 years ago

Yes, both parameters have been set to 'External (only links stored in Moodle)' on Moodle 3.9.