turnitin / moodle-plagiarism_turnitin

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

Request: add webservices for Turnitin #673

Open Richardvi opened 1 year ago

Richardvi commented 1 year ago

Hi!

We really need webservices for Moodle that gives us the possibility to enable/disable turnitin on an assignment.

Why? We are using webservices to create assignments in Moodle. However, we have noticed that it is impossible to enable turnitin when creating an assignment in this way. So all settings have to be done manually.

Could you please make webservices available for enabling/disabling turnitin?

Thanks!

Richard.

mhughes2k commented 1 year ago

I think this is an interesting one, as I don't think it should something that should be set up by talking to the Turnitin Plagiarism plugin directly, as the settings relate to the configuration of an assignment activity.

If you follow the moodle pattern this configuration exists on the assignment settings page.

I'm not sure it's a good idea to have 2 separate calls to configure different aspects of the same activity.

That said I'm not sure I can see a Moodle webservice that actually can create an assignment!

Richardvi commented 1 year ago

We have created our own webservice and we've been using this for a couple of years to add assignments to a course. You suggest we could better extend the functionality of that existing webservice?

mhughes2k commented 1 year ago

IMHO that would make the more sensible option since Moodle doesn't offer an API to do that.

Presumably you're already hooking into the mod creation processes in modlib.php, which is what the Moodle UI for creating a module passes all it's data into? If so you should be able to just pass in the relevant "form" elements to the data you pass in via $moduleinfo into the add_moduleinfo() function.

This should then pass the relevant parts to the whole module creation sub-system, which at the moment hooks into plagiarism_save_form_elements() function to configure the plagiarism plugin for that module instance.

This also hooks into a callback that the Turnitin plugin should have implemented to handle saving the plagiarism plugin's configuration as as result of a module creation.

If you'renot using the modlib.php functions (ie creating directly in the database) to create assignment activities, then you're missing out on all of the handling of all the activity plugin feature handling.

(it would also be nice if Moodle offered a Create Module Web Service API that did most of this hard work for you, and took a data structure, rather than the mform data from the UI).

Richardvi commented 1 year ago

Thanks! We are using modlib.php (webservice). I will pass your info to our developer.

And yes, a 'create module' webservice is very much needed.