turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
GNU General Public License v3.0
48 stars 70 forks source link

update_grade() method should use Moodle API #496

Closed micaherne closed 3 months ago

micaherne commented 4 years ago

The method plagiarism_plugin_turnitin::update_grade() that is ultimately called when a grade is received from Feedback Studio is doing a simplistic process with direct database manipulation. This is not sufficient for compatibility with Moodle and should instead be using the Moodle API (specifically assign::save_grade() for mod_assign)

The specific issue I am encountering is that feedback plugins are not having their callbacks called, so are unable to process the new grade. Everywhere in core Moodle where assignment grades are saved or updated results in these being called.

There are a host of other issues though, for example:

It's also possible that moving to assign::save_grade() would simplify the code as it deals transparently with things like team submissions

prosserg commented 4 years ago

Hi micaherne We are seeing similar problems to those you report in this plugin. What is the version of the plugin you are commenting on please ? We are using 2019070201 and wondering if these issues persist in 2019121701

mhughes2k commented 2 years ago

Just to give this a bump but in 2022 it still seems that the TII plugin does not use the mod-assign API for grades and is still writing directly to the assign_grades table in the update_grades() function: https://github.com/turnitin/moodle-plagiarism_turnitin/blob/fd36a2bf2379aed52b056d4fff184545ede87ac6/lib.php#L1443 where it does a $DB->update_record($table, $grade) ($table is basically a reference to "assign_grades" as found in the turnitin_assign.class.php)

So TII is still bypassing all of the Moodle's assignment grade sub-systems, which implements an "update_grades()" function that can be publicly called to do everything correctly, including checking blind marking, marking workflow and team grading and doesn't rely on Turnitin replicating all of this logic.

carl-hostrander commented 3 months ago

Thank you for reporting this. Because the latest version of the plagiarism plugin is supported for versions of Moodle 4.1 and higher, I am closing this ticket. However, if you find this issue is occurring with the latest version of the plugin in any of the supported Moodle versions, please create a new ticket and we will address it.