PlagiarismCheck/moodle-plagiarism_pchkorg

plagiarism_plugin_pchkorg::get_links should be more efficient

danmarsden opened this issue · 1 comments

the function "get_links" can be called multiple times on a single page - particularly when a teacher is viewing a large number of submissions. For this reason you should be implementing some static vars.

Things like the following should only happen once per page load - no matter how many times get_links is called on a single page:

  • Is pchk enabled.
  • is pchk enabled for "This" module
  • is_group_member - this one scare me - it makes an external curl call - what happens if that is failing? - does it kill the assignment grading page? - what happens when it fails and is called 50 times on the page?

Static vars have been added.
In new version (3.2) Method is_group_member will be called only once and maximum timeout is 2 seconds.

https://github.com/PlagiarismCheck/moodle-plagiarism_pchkorg/blob/master/classes/plagiarism_pchkorg_api_provider.php#L353