Skip to content

Commit c0ff5ff

Browse files
committed
Updates on explanation on how calls to the webservice are generated from $SITE_URL and REQUEST_URI()
1 parent 87a280d commit c0ff5ff

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

lib/FormatRenderedProblem.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ sub formatRenderedProblem {
261261
my $userID = $self->{userID}//'';
262262
my $course_password = $self->{course_password}//'';
263263
my $problemSeed = $self->{inputs_ref}->{problemSeed}//6666;
264-
my $psvn = $self->{inputs_ref}->{psvn}//54321;
264+
my $psvn = $self->{inputs_ref}->{psvn}//54321;
265265
my $session_key = $rh_result->{session_key}//'';
266266
my $displayMode = $self->{inputs_ref}->{displayMode};
267267

@@ -270,10 +270,10 @@ sub formatRenderedProblem {
270270
my $checkMode = defined($self->{inputs_ref}->{WWcheck})||0;
271271
my $submitMode = defined($self->{inputs_ref}->{WWsubmit})||0;
272272
my $showCorrectMode = defined($self->{inputs_ref}->{WWcorrectAns})||0;
273-
# problemUUID can be added to the request as a parameter.
274-
# It adds a prefix to the
275-
# identifier used by the format so that several different problems
276-
# can appear on the same page.
273+
# problemUUID can be added to the request as a parameter.
274+
# It adds a prefix to the
275+
# identifier used by the format so that several different problems
276+
# can appear on the same page.
277277
my $problemUUID = $self->{inputs_ref}->{problemUUID}//0;
278278
my $problemResult = $rh_result->{problem_result}//'';
279279
my $problemState = $rh_result->{problem_state}//'';

lib/WeBWorK/ContentGenerator/instructorXMLHandler.pm

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,55 +46,53 @@ use JSON;
4646
#################################################
4747
instructorXMLHandler -- a front end for the Webservice that accepts HTML forms
4848
49-
receives WeBWorK problems presented as HTML forms, usually created with js xmlhttprequests,
50-
packages the form variables into an XML_RPC request
49+
receives WeBWorK problems presented as HTML forms, usually created with js xmlhttprequests,
50+
packages the form variables into an XML_RPC request
5151
suitable for all of the webservices in WebworkWebservices
5252
returns xml resutls
5353
#################################################
5454
5555
=cut
5656

5757
# To configure the target webwork server two URLs are required
58-
# 1. http://test.webwork.maa.org/mod_xmlrpc
58+
# 1. http://test.webwork.maa.org/mod_xmlrpc
5959
# points to the Webservice.pm and Webservice/RenderProblem modules
6060
# Is used by the client to send the original XML request to the webservice
61-
# Note: This not the same as the webworkClient->url which should NOT have
62-
# the mod_xmlrpc segment.
63-
# 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml
64-
# points to the renderViaXMLRPC.pm module.
61+
# Note: This NOT the same as the webworkClient->url which does NOT have
62+
# the mod_xmlrpc segment attached. webworkClient->url would be http://test.webwork.maa.org
63+
# The mod_xmlrpc segment is added by WebworkClient.pm when issuing the webservice call
64+
# using the constant REQUEST_URI within the subroutine xmlrpcCall
65+
# 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/instructorXMLHandler
66+
# points to the instructorXMLHandler.pm module.
6567
#
6668
# This url is placed as form action url when the rendered HTML from the original
6769
# request is returned to the client from Webservice/RenderProblem. The client
6870
# reorganizes the XML it receives into an HTML page (with a WeBWorK form) and
6971
# pipes it through a local browser.
7072
#
7173
# The browser uses this url to resubmit the problem (with answers) via the standard
72-
# HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler.
74+
# HTML webform used by WeBWorK to the instructorXMLHandler.pm handler.
7375
#
74-
# This renderViaXMLRPC.pm handler acts as an intermediary between the browser
76+
# This instructorXMLHandler.pm handler acts as an intermediary between the browser
7577
# and the webservice. It interprets the HTML form sent by the browser,
7678
# rewrites the form data in XML format, submits it to the WebworkWebservice.pm
7779
# which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm
7880
# which in turn passes it back to the browser.
79-
# 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form
81+
# 3. The second time a problem is submitted instructorXMLHandler.pm receives the WeBWorK form
8082
# submitted directly by the browser.
81-
# The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice
83+
# The instructorXMLHandler.pm translates the WeBWorK form, has it processed by the webservice
8284
# and returns the result to the browser.
8385
# The The client renderProblem.pl script is no longer involved.
84-
# 4. Summary: renderProblem.pl is only involved in the first round trip
85-
# of the submitted problem. After that the communication is between the browser and
86-
# renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm
87-
# module using XML_RPC.
8886

8987

9088
# Determine the root directory for webwork on this machine (e.g. /opt/webwork/webwork2 )
9189
# this is set in webwork.apache2-config
9290
# it specifies the address of the webwork root directory
9391

94-
#my $webwork_dir = $ENV{WEBWORK_ROOT};
92+
9593
my $webwork_dir = $WeBWorK::Constants::WEBWORK_DIRECTORY;
9694
unless ($webwork_dir) {
97-
die "renderViaXMLRPC.pm requires that the top WeBWorK directory be set in ".
95+
die " instructorXMLHandler.pm requires that the top WeBWorK directory be set in ".
9896
"\$WeBWorK::Constants::WEBWORK_DIRECTORY by webwork.apache-config or webwork.apache2-config\n";
9997
}
10098

lib/WeBWorK/ContentGenerator/renderViaXMLRPC.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ use CGI;
5454
=cut
5555

5656
# To configure the target webwork server two URLs are required
57-
# 1. http://test.webwork.maa.org/mod_xmlrpc
57+
# 1. The url http://test.webwork.maa.org/mod_xmlrpc
5858
# points to the Webservice.pm and Webservice/RenderProblem modules
59-
# Is used by the client to send the original XML request to the webservice
59+
# Is used by the client to send the original XML request to the webservice.
60+
# It is constructed in WebworkClient::xmlrpcCall() from the value of $webworkClient->site_url which does
61+
# NOT have the mod_xmlrpc segment (it should be http://test.webwork.maa.org)
62+
# and the constant REQUEST_URI defined in WebworkClient.pm to be mod_xmlrpc.
6063
#
6164
# 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml
6265
# points to the renderViaXMLRPC.pm module.

0 commit comments

Comments
 (0)