turnitin / moodle-plagiarism_turnitin

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

Request: add webservices for Turnitin #673

Open Richardvi opened 10 months ago

Richardvi commented 10 months 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 10 months 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 10 months 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 10 months 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 10 months 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.