pauln / moodle-report_componentgrades

Excel spreadsheet export tool for individual component grades in Marking Guides and Rubrics.
GNU General Public License v3.0
2 stars 13 forks source link

Update locallib.php #4

Open vsotirasqmplus opened 6 years ago

vsotirasqmplus commented 6 years ago

Avoid Moodle Query duplicate records error by adding a unique id for each tuple

marcusgreen commented 6 years ago

Could you elaborate on a situation where this update would be required? I am concerned that your code may not be portable across different database systems and the plugin should at least work with MysQL,Postgres and MS SQL Server.

vsotirasqmplus commented 6 years ago

I am sure there could be conflicts with other databases than MySQL. but the basic principle of Moodle $DB object is to retrieve tuples having their first field to be a unique identifier, which in our installation was the case, forcing Moodle to abandon records and retrieve only the ones having distinct values at the first field. So my suggestion is for MySQL, and based on identifying other databases, the principle of the $DB object query must be kept.