| … | |
… | |
| 33 | |
33 | |
| 34 | use strict; |
34 | use strict; |
| 35 | use warnings; |
35 | use warnings; |
| 36 | |
36 | |
| 37 | |
37 | |
|
|
38 | # To configure the target webwork server |
|
|
39 | # two URLs are required |
|
|
40 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
|
|
41 | # points to the Webservice.pm and Webservice/RenderProblem modules |
|
|
42 | # Is used by the client to send the original XML request to the webservice |
|
|
43 | # |
|
|
44 | # 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml |
|
|
45 | # points to the renderViaXMLRPC.pm module. |
|
|
46 | # |
|
|
47 | # This url is placed as form action url when the rendered HTML from the original |
|
|
48 | # request is returned to the client from Webservice/RenderProblem. The client |
|
|
49 | # reorganizes the XML it receives into an HTML page (with a WeBWorK form) and |
|
|
50 | # pipes it through a local browser. |
|
|
51 | # |
|
|
52 | # The browser uses this url to resubmit the problem (with answers) via the standard |
|
|
53 | # HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler. |
|
|
54 | # |
|
|
55 | # This renderViaXMLRPC.pm handler acts as an intermediary between the browser |
|
|
56 | # and the webservice. It interprets the HTML form sent by the browser, |
|
|
57 | # rewrites the form data in XML format, submits it to the WebworkWebservice.pm |
|
|
58 | # which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm |
|
|
59 | # which in turn passes it back to the browser. |
|
|
60 | # 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form |
|
|
61 | # submitted directly by the browser. |
|
|
62 | # The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice |
|
|
63 | # and returns the result to the browser. |
|
|
64 | # The The client renderProblem.pl script is no longer involved. |
|
|
65 | # 4. Summary: renderProblem.pl is only involved in the first round trip |
|
|
66 | # of the submitted problem. After that the communication is between the browser and |
|
|
67 | # renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm |
|
|
68 | # module using XML_RPC. |
|
|
69 | |
| 38 | # To configure the target webwork server |
70 | # To configure the target webwork server |
| 39 | # two URLs are required |
71 | # two URLs are required |
| 40 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
72 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
| 41 | # points to the Webservice.pm and Webservice/RenderProblem modules |
73 | # points to the Webservice.pm and Webservice/RenderProblem modules |
| 42 | # Is used by the client to send the original XML request to the webservice |
74 | # Is used by the client to send the original XML request to the webservice |
| … | |
… | |
| 420 | |
452 | |
| 421 | my $XML_URL = $self->url; |
453 | my $XML_URL = $self->url; |
| 422 | my $FORM_ACTION_URL = $self->{form_action_url}; |
454 | my $FORM_ACTION_URL = $self->{form_action_url}; |
| 423 | my $problemTemplate = <<ENDPROBLEMTEMPLATE; |
455 | my $problemTemplate = <<ENDPROBLEMTEMPLATE; |
| 424 | |
456 | |
|
|
457 | |
| 425 | <html> |
458 | <html> |
| 426 | <head> |
459 | <head> |
| 427 | <base href="$XML_URL"> |
460 | <base href="$XML_URL"> |
| 428 | <title>$XML_URL WeBWorK Editor using host $XML_URL</title> |
461 | <title>$XML_URL WeBWorK Editor using host $XML_URL</title> |
| 429 | </head> |
462 | </head> |