NAME

WebworkWebservice

SYNPOSIS

my $rpc_service = WebworkWebservice->new($c);
await $rpc_service->rpc_execute('command_to_execute');

After that, if the command is 'renderProblem', use

my $result = $rpc_service->formatRenderedProblem;

to obtain the result in the requested 'outputformat'.

DESCRIPTION

The WebworkWebservice executes a requested command and returns with the result. The webservice command methods are available are in the following modules:

WebworkWebservice::RenderProblem;
WebworkWebservice::LibraryActions;
WebworkWebservice::SetActions;
WebworkWebservice::CourseActions;
WebworkWebservice::ProblemActions

Note that WebworkWebservice contains the formatRenderedProblem method for formatting the reply returned by the renderProblem command.

Also note that the WeBWorK::ContentGenerator::RenderViaRPC module implements the renderProblem command, and the WeBWorK::ContentGenerator::InstructorPRCHandler module has implements all other commands.

new (constructor)

Accessor methods

return_object
error_string

rpc_execute

This method executes a WebworkWebservice command, and makes sure that credentials are returned in the result on success. The result will be stored in the result_object of the instance. An error_string will be set on failure.

formatRenderedProblem

This is called by WeBWorK::ContentGenerator::RenderViaRPC::pre_header_initialize to format the return result of the WebworkWebservice::renderProblem method. This method calls HardcopyRenderedProblem::hardcopyRenderedProblem if the outputformat is tex or pdf, and calls FormatRenderedProblem::formatRenderedProblem otherwise.

c

Returns the WeBWorK::Controller object contained in $webworkRPC.

Pass through methods which access the data in the WeBWorK::Controller object

ce
db
params
authz
authen
maketext

command_permission

This returns the permission required to perform the commands offered by the WebworkWebservice. Note that all available commands must be listed here or the command will not be allowed.