PlagiarismCheck / moodle-plagiarism_pchkorg

Plagiarismcheck.org is a sophisticated similarity search engine. We advocate for bringing technology into academics to help instructors save time and motivate students write better papers.
https://plagiarismcheck.org
GNU General Public License v3.0
13 stars 4 forks source link

invalid use of Moodle DB API functions #15

Closed danmarsden closed 5 years ago

danmarsden commented 5 years ago

As previously mentioned in issue #4 your use of the DB api does not follow Moodle guidelines.

In particular your plagiarism_pchkorg_config_model class which puts $DB into $this->DB

At the very least you should be using Global $DB and just use the global $DB from within your functions in plagiarism_pchkorg_config_model but you are also abstracting simple db api calls instead of calling them directly (eg fetch_by_module) - there's no point in the fetch_by_module funciton - you should just make this api call directly in your is_enabled_for_module function.

JaneAdelmann commented 5 years ago

Issue has been fixed. We do not use abstration for $DB anymore. Thank you for report.