turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
45 stars 65 forks source link

get_links() does not check for enabled activity types causing significant performance problem #622

Open thepurpleblob opened 2 years ago

thepurpleblob commented 2 years ago

Referring to plagiarism/turnitin/lib.php function get_links()

This checks if an activity is a quiz and gets information for the quiz. However, there is no check here whether the quiz activity is enabled in the Turnitin settings. Worse, this appears to be called for each attempt in the quiz (possibly a quiz issue). As the 'load_questions_usage_by_activity()' call is relatively expensive this makes displaying the report incredibly slow.

Real life example - with page size set to show all 140 attempts and plagiarism on, approx 20 minutes. With plagiarism off, approx 30 seconds.

There needs to be a specific check in get_links() to ensure data is not collected for activity types where Turnitin is not enabled.

See also (related) https://github.com/turnitin/moodle-plagiarism_turnitin/issues/591

Also related, https://github.com/turnitin/moodle-plagiarism_turnitin/issues/593