[system] / trunk / webwork-modperl / clients / webwork_xmlrpc_client.pl Repository:
ViewVC logotype

Diff of /trunk/webwork-modperl/clients/webwork_xmlrpc_client.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 6232 Revision 6233
16 16
17use XMLRPC::Lite; 17use XMLRPC::Lite;
18use MIME::Base64 qw( encode_base64 decode_base64); 18use MIME::Base64 qw( encode_base64 decode_base64);
19 19
20# configuration section 20# configuration section
21use constant PROTOCOL => 'https'; # or 'http'; 21use constant PROTOCOL => 'http'; # or 'http';
22use constant HOSTURL => 'webwork.rochester.edu'; 22use constant HOSTURL => 'localhost';
23use constant HOSTPORT => '443'; # or 80 23use constant HOSTPORT => '80'; # or 80
24use constant TRANSPORT_METHOD => 'XMLRPC::Lite'; 24use constant TRANSPORT_METHOD => 'XMLRPC::Lite';
25use constant REQUEST_CLASS =>'WebworkXMLRPC'; # WebworkXMLRPC is used for soap also!! 25use constant REQUEST_CLASS =>'WebworkXMLRPC'; # WebworkXMLRPC is used for soap also!!
26use constant REQUEST_URI =>'mod_xmlrpc'; 26use constant REQUEST_URI =>'mod_xmlrpc';
27use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; 27use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html';
28use constant COURSE => 'daemon2_course'; 28use constant COURSE => 'gage_course';
29 29
30 30
31 31
32my @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf 32my @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf
33 33
72 72
73 my $requestResult = TRANSPORT_METHOD 73 my $requestResult = TRANSPORT_METHOD
74 #->uri('http://'.HOSTURL.':'.HOSTPORT.'/'.REQUEST_CLASS) 74 #->uri('http://'.HOSTURL.':'.HOSTPORT.'/'.REQUEST_CLASS)
75 -> proxy(PROTOCOL.'://'.HOSTURL.':'.HOSTPORT.'/'.REQUEST_URI); 75 -> proxy(PROTOCOL.'://'.HOSTURL.':'.HOSTPORT.'/'.REQUEST_URI);
76 76
77 my $test = [3,4,5,6]; 77 # my $test = [3,4,5,6];
78 my $input = setInputTable(); 78 my $input = setInputTable();
79 print "displayMode=",$input->{envir}->{displayMode},"\n"; 79 print "displayMode=",$input->{envir}->{displayMode},"\n";
80 local( $result); 80 local( $result);
81 # use eval to catch errors 81 # use eval to catch errors
82 eval { $result = $requestResult->call(REQUEST_CLASS.'.'.$command,$input) }; 82 eval { $result = $requestResult->call(REQUEST_CLASS.'.'.$command,$input) };
144 144
145sub setInputTable_for_listLib { 145sub setInputTable_for_listLib {
146 $out = { 146 $out = {
147 pw => 'geometry', 147 pw => 'geometry',
148 set => 'set0', 148 set => 'set0',
149 library_name => 'rochesterLibrary', 149 library_name => 'Library',
150 command => 'all', 150 command => 'all',
151 }; 151 };
152 152
153 $out; 153 $out;
154} 154}
155sub setInputTable { 155sub setInputTable {
156 $out = { 156 $out = {
157 pw => 'geometry', 157 pw => 'geometry',
158 set => 'set0', 158 set => 'set0',
159 library_name => 'rochesterLibrary', 159 library_name => 'Library',
160 command => 'all', 160 command => 'all',
161 answer_form_submitted => 1, 161 answer_form_submitted => 1,
162 course => COURSE(), 162 course => COURSE(),
163 extra_packages_to_load => [qw( AlgParserWithImplicitExpand Expr 163 extra_packages_to_load => [qw( AlgParserWithImplicitExpand Expr
164 ExprWithImplicitExpand AnswerEvaluator 164 ExprWithImplicitExpand AnswerEvaluator

Legend:
Removed from v.6232  
changed lines
  Added in v.6233

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9