-
Improvement
-
Resolution: Fixed
-
Minor
-
1.9.4
-
None
-
Any
-
MOODLE_19_STABLE
-
MOODLE_20_STABLE
I'm developing an assignment type in which the user submits a Mahara View within Moodle. It needs to call a couple of xmlrpc methods on a networked Mahara site. It is a requirement that this works in Moodle 1.9, so I need to ensure that the methods are defined on the Moodle side (even though they will never be called in Moodle), otherwise the user will not be permitted to send the method calls to the Mahara site.
Modules can publish rpc methods currently in their rpclib.php file, but "sub" modules like assignment types and resource types cannot.
Here are two possible solutions:
(1) Add an rpclib.php in mod/assignment which 'collects' the published rpc functions from all the assignment types (see the file assignment_rpclib.patch).
- The xmlrpc method bar provided by assignment type foo will be called 'mod/assignment/rpclib.php/bar'
- If resource types want to publish rpc functions, a nearly identical rpclib.php could go in mod/resource too.
(2) Modify admin/mnet/adminlib.php to look for rpclib.php files in mod/assignment/type/, mod/resource/type/ (see the file mnet_adminlib.patch)
- The xmlrpc method bar provided by assignment type foo will be called 'mod/assignment/type/foo/rpclib.php/bar'
- No need to add rpclib.php files in mod/assignment, mod/resource.