The receiver address basically "groups" the assignment into a specific account within urkund, but once created, an assignment usually stays allocated to that specific reciever address.
Few things to be aware of in terms of existing handling of the reciever address.
The site admin can set a "default" receiver address to use on new assignments.
The users own last used reciever address is stored /cached in their own user preferences.
eg - when creating a new assignment, it checks if this user has a reciever address in their preferences - if yes, it uses this address. If no, it uses the site default setting.
New behaviour:
remove the "site-default" receiver address setting as this will not longer be used.
Create an upgrade script to clear the existing urkund_receiver user_preference field for all users.
Upon creating an assignment with Urkund check the user preference field like normal, but if empty, a lookup is made against Urkunds new API checking if a receiver is already associated for that user. This lookup is made using that users email address in Moodle. If we get a response, store that in the users prefererence so we don't have to make this call each time. I'm wondering if we can use an Ajax call to facilitate this so that the page-load of the activity creation isn't reliant on the external http post.
If we get a response to say a receiver does not exist this flow is followed:
3a Send a create receiver request to Urkunds API for the email that the user has in Moodle.
3b Wait for Urkunds API to respond back with the newly created receiver object
3ba Urkunds API can in some cases respond back with http status code “403 – Forbidden”. If that
happens an error should be displayed to the user stating that they need to manually enter
an analysis address
Ideally we want to make this as seemless as possible, so a combination of ajax calls and other checks in the validation function would be good.
The receiver address basically "groups" the assignment into a specific account within urkund, but once created, an assignment usually stays allocated to that specific reciever address.
Few things to be aware of in terms of existing handling of the reciever address. The site admin can set a "default" receiver address to use on new assignments. The users own last used reciever address is stored /cached in their own user preferences. eg - when creating a new assignment, it checks if this user has a reciever address in their preferences - if yes, it uses this address. If no, it uses the site default setting.
New behaviour:
remove the "site-default" receiver address setting as this will not longer be used.
Create an upgrade script to clear the existing urkund_receiver user_preference field for all users.
Upon creating an assignment with Urkund check the user preference field like normal, but if empty, a lookup is made against Urkunds new API checking if a receiver is already associated for that user. This lookup is made using that users email address in Moodle. If we get a response, store that in the users prefererence so we don't have to make this call each time. I'm wondering if we can use an Ajax call to facilitate this so that the page-load of the activity creation isn't reliant on the external http post.
If we get a response to say a receiver does not exist this flow is followed: 3a Send a create receiver request to Urkunds API for the email that the user has in Moodle. 3b Wait for Urkunds API to respond back with the newly created receiver object
3ba Urkunds API can in some cases respond back with http status code “403 – Forbidden”. If that happens an error should be displayed to the user stating that they need to manually enter an analysis address
Ideally we want to make this as seemless as possible, so a combination of ajax calls and other checks in the validation function would be good.