| … | |
… | |
| 32 | =cut |
32 | =cut |
| 33 | |
33 | |
| 34 | use strict; |
34 | use strict; |
| 35 | use warnings; |
35 | use warnings; |
| 36 | |
36 | |
|
|
37 | <<<<<<< .working |
|
|
38 | <<<<<<< .working |
|
|
39 | <<<<<<< .working |
| 37 | |
40 | |
| 38 | |
41 | |
| 39 | ################################################## |
42 | ################################################## |
| 40 | # configuration section for client |
43 | # configuration section for client |
| 41 | ################################################## |
44 | ################################################## |
| … | |
… | |
| 48 | |
51 | |
| 49 | ############################################# |
52 | ############################################# |
| 50 | # Configure |
53 | # Configure |
| 51 | ############################################# |
54 | ############################################# |
| 52 | |
55 | |
|
|
56 | <<<<<<< .working |
| 53 | ############################################################ |
57 | ############################################################ |
| 54 | # configure the local output file and display command !!!!!!!! |
58 | # configure the local output file and display command !!!!!!!! |
| 55 | ############################################################ |
59 | ############################################################ |
| 56 | |
60 | ======= |
|
|
61 | ############################################################ |
|
|
62 | # configure the local output file and display command !!!!!!!! |
|
|
63 | ############################################################ |
|
|
64 | |
| 57 | # Path to a temporary file for storing the output of renderProblem.pl |
65 | # Path to a temporary file for storing the output of renderProblem.pl |
| 58 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
66 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
| 59 | |
67 | |
| 60 | # Command line for displaying the temporary file in a browser. |
68 | # Command line for displaying the temporary file in a browser. |
| 61 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
69 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
| 62 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
70 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
| 63 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
71 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
| … | |
… | |
| 104 | # module using XML_RPC. |
112 | # module using XML_RPC. |
| 105 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
113 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
| 106 | # may be implemented. This is sufficient to keep out robots. |
114 | # may be implemented. This is sufficient to keep out robots. |
| 107 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
115 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
| 108 | # result. A different name can be used but the course must exist on the server. |
116 | # result. A different name can be used but the course must exist on the server. |
|
|
117 | >>>>>>> .merge-right.r6936 |
| 109 | |
118 | |
|
|
119 | <<<<<<< .working |
|
|
120 | # Path to a temporary file for storing the output of renderProblem.pl |
|
|
121 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
|
|
122 | |
|
|
123 | # Command line for displaying the temporary file in a browser. |
|
|
124 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
|
|
125 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
|
|
126 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
|
|
127 | ############################################################ |
|
|
128 | |
|
|
129 | my $use_site; |
|
|
130 | $use_site = 'test_webwork'; # select a rendering site |
|
|
131 | #$use_site = 'local'; # select a rendering site |
|
|
132 | #$use_site = 'rochester_test'; # select a rendering site |
|
|
133 | |
|
|
134 | |
|
|
135 | ############################################################ |
|
|
136 | |
|
|
137 | # To configure the target webwork server |
|
|
138 | # two URLs are required |
|
|
139 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
|
|
140 | # points to the Webservice.pm and Webservice/RenderProblem modules |
|
|
141 | # Is used by the client to send the original XML request to the webservice |
|
|
142 | # |
|
|
143 | # 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml |
|
|
144 | # points to the renderViaXMLRPC.pm module. |
|
|
145 | # |
|
|
146 | # This url is placed as form action url when the rendered HTML from the original |
|
|
147 | # request is returned to the client from Webservice/RenderProblem. The client |
|
|
148 | # reorganizes the XML it receives into an HTML page (with a WeBWorK form) and |
|
|
149 | # pipes it through a local browser. |
|
|
150 | # |
|
|
151 | # The browser uses this url to resubmit the problem (with answers) via the standard |
|
|
152 | # HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler. |
|
|
153 | # |
|
|
154 | # This renderViaXMLRPC.pm handler acts as an intermediary between the browser |
|
|
155 | # and the webservice. It interprets the HTML form sent by the browser, |
|
|
156 | # rewrites the form data in XML format, submits it to the WebworkWebservice.pm |
|
|
157 | # which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm |
|
|
158 | # which in turn passes it back to the browser. |
|
|
159 | # 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form |
|
|
160 | # submitted directly by the browser. |
|
|
161 | # The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice |
|
|
162 | # and returns the result to the browser. |
|
|
163 | # The The client renderProblem.pl script is no longer involved. |
|
|
164 | # 4. Summary: renderProblem.pl is only involved in the first round trip |
|
|
165 | # of the submitted problem. After that the communication is between the browser and |
|
|
166 | # renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm |
|
|
167 | # module using XML_RPC. |
|
|
168 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
|
|
169 | # may be implemented. This is sufficient to keep out robots. |
|
|
170 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
|
|
171 | # result. A different name can be used but the course must exist on the server. |
|
|
172 | ======= |
|
|
173 | ======= |
|
|
174 | >>>>>>> .merge-right.r6936 |
|
|
175 | ======= |
|
|
176 | >>>>>>> .merge-right.r6936 |
|
|
177 | ======= |
|
|
178 | >>>>>>> .merge-right.r6936 |
| 110 | |
179 | |
| 111 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
180 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
| 112 | if ($use_site eq 'local') { |
181 | if ($use_site eq 'local') { |
| 113 | # the rest can work!! |
182 | # the rest can work!! |
| 114 | $XML_URL = 'http://localhost:80'; |
183 | $XML_URL = 'http://localhost:80'; |
| … | |
… | |
| 122 | $XML_PASSWORD = 'xmlwebwork'; |
191 | $XML_PASSWORD = 'xmlwebwork'; |
| 123 | $XML_COURSE = 'daemon_course'; |
192 | $XML_COURSE = 'daemon_course'; |
| 124 | |
193 | |
| 125 | } elsif ($use_site eq 'test_webwork') { |
194 | } elsif ($use_site eq 'test_webwork') { |
| 126 | |
195 | |
|
|
196 | <<<<<<< .working |
|
|
197 | <<<<<<< .working |
|
|
198 | <<<<<<< .working |
| 127 | $XML_URL = 'https://test.webwork.maa.org'; |
199 | $XML_URL = 'https://test.webwork.maa.org'; |
| 128 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
200 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
| 129 | $XML_PASSWORD = 'xmlwebwork'; |
201 | $XML_PASSWORD = 'xmlwebwork'; |
| 130 | $XML_COURSE = 'daemon_course'; |
202 | $XML_COURSE = 'daemon_course'; |
|
|
203 | ======= |
|
|
204 | ################################################## |
|
|
205 | # configuration section for client |
|
|
206 | ################################################## |
|
|
207 | >>>>>>> .merge-right.r6936 |
|
|
208 | ======= |
|
|
209 | ################################################## |
|
|
210 | # configuration section for client |
|
|
211 | ################################################## |
|
|
212 | >>>>>>> .merge-right.r6936 |
|
|
213 | ======= |
|
|
214 | ################################################## |
|
|
215 | # configuration section for client |
|
|
216 | ################################################## |
|
|
217 | >>>>>>> .merge-right.r6936 |
| 131 | |
218 | |
|
|
219 | <<<<<<< .working |
|
|
220 | <<<<<<< .working |
|
|
221 | <<<<<<< .working |
| 132 | } |
222 | } |
|
|
223 | ======= |
|
|
224 | # Use address to WeBWorK code library where WebworkClient.pm is located. |
|
|
225 | use lib '/opt/webwork/webwork2/lib'; |
|
|
226 | #use Crypt::SSLeay; # needed for https |
|
|
227 | use WebworkClient; |
|
|
228 | >>>>>>> .merge-right.r6936 |
|
|
229 | ======= |
|
|
230 | # Use address to WeBWorK code library where WebworkClient.pm is located. |
|
|
231 | use lib '/opt/webwork/webwork2/lib'; |
|
|
232 | #use Crypt::SSLeay; # needed for https |
|
|
233 | use WebworkClient; |
|
|
234 | >>>>>>> .merge-right.r6936 |
|
|
235 | ======= |
|
|
236 | # Use address to WeBWorK code library where WebworkClient.pm is located. |
|
|
237 | use lib '/opt/webwork/webwork2/lib'; |
|
|
238 | #use Crypt::SSLeay; # needed for https |
|
|
239 | use WebworkClient; |
|
|
240 | >>>>>>> .merge-right.r6936 |
| 133 | |
241 | |
|
|
242 | <<<<<<< .working |
|
|
243 | <<<<<<< .working |
|
|
244 | <<<<<<< .working |
| 134 | ################################################## |
245 | ################################################## |
| 135 | # END configuration section for client |
246 | # END configuration section for client |
| 136 | ################################################## |
247 | ################################################## |
|
|
248 | ======= |
|
|
249 | >>>>>>> .merge-right.r6936 |
|
|
250 | ======= |
|
|
251 | >>>>>>> .merge-right.r6936 |
|
|
252 | ======= |
|
|
253 | >>>>>>> .merge-right.r6936 |
| 137 | |
254 | |
|
|
255 | ############################################# |
|
|
256 | # Configure |
|
|
257 | ############################################# |
| 138 | |
258 | |
|
|
259 | <<<<<<< .working |
|
|
260 | <<<<<<< .working |
|
|
261 | <<<<<<< .working |
|
|
262 | ======= |
|
|
263 | ############################################################ |
|
|
264 | # configure the local output file and display command !!!!!!!! |
|
|
265 | ############################################################ |
|
|
266 | |
|
|
267 | # Path to a temporary file for storing the output of renderProblem.pl |
|
|
268 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
|
|
269 | |
|
|
270 | # Command line for displaying the temporary file in a browser. |
|
|
271 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
|
|
272 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
|
|
273 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
|
|
274 | ############################################################ |
|
|
275 | |
|
|
276 | my $use_site; |
|
|
277 | $use_site = 'test_webwork'; # select a rendering site |
|
|
278 | #$use_site = 'local'; # select a rendering site |
|
|
279 | #$use_site = 'rochester_test'; # select a rendering site |
|
|
280 | |
|
|
281 | |
|
|
282 | ############################################################ |
|
|
283 | |
|
|
284 | # To configure the target webwork server |
|
|
285 | # two URLs are required |
|
|
286 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
|
|
287 | # points to the Webservice.pm and Webservice/RenderProblem modules |
|
|
288 | # Is used by the client to send the original XML request to the webservice |
|
|
289 | # |
|
|
290 | # 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml |
|
|
291 | # points to the renderViaXMLRPC.pm module. |
|
|
292 | # |
|
|
293 | # This url is placed as form action url when the rendered HTML from the original |
|
|
294 | # request is returned to the client from Webservice/RenderProblem. The client |
|
|
295 | # reorganizes the XML it receives into an HTML page (with a WeBWorK form) and |
|
|
296 | # pipes it through a local browser. |
|
|
297 | # |
|
|
298 | # The browser uses this url to resubmit the problem (with answers) via the standard |
|
|
299 | # HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler. |
|
|
300 | # |
|
|
301 | # This renderViaXMLRPC.pm handler acts as an intermediary between the browser |
|
|
302 | # and the webservice. It interprets the HTML form sent by the browser, |
|
|
303 | # rewrites the form data in XML format, submits it to the WebworkWebservice.pm |
|
|
304 | # which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm |
|
|
305 | # which in turn passes it back to the browser. |
|
|
306 | # 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form |
|
|
307 | # submitted directly by the browser. |
|
|
308 | # The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice |
|
|
309 | # and returns the result to the browser. |
|
|
310 | # The The client renderProblem.pl script is no longer involved. |
|
|
311 | # 4. Summary: renderProblem.pl is only involved in the first round trip |
|
|
312 | # of the submitted problem. After that the communication is between the browser and |
|
|
313 | # renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm |
|
|
314 | # module using XML_RPC. |
|
|
315 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
|
|
316 | # may be implemented. This is sufficient to keep out robots. |
|
|
317 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
|
|
318 | # result. A different name can be used but the course must exist on the server. |
|
|
319 | >>>>>>> .merge-right.r6936 |
|
|
320 | ======= |
|
|
321 | ############################################################ |
|
|
322 | # configure the local output file and display command !!!!!!!! |
|
|
323 | ############################################################ |
|
|
324 | |
|
|
325 | # Path to a temporary file for storing the output of renderProblem.pl |
|
|
326 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
|
|
327 | |
|
|
328 | # Command line for displaying the temporary file in a browser. |
|
|
329 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
|
|
330 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
|
|
331 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
|
|
332 | ############################################################ |
|
|
333 | |
|
|
334 | my $use_site; |
|
|
335 | $use_site = 'test_webwork'; # select a rendering site |
|
|
336 | #$use_site = 'local'; # select a rendering site |
|
|
337 | #$use_site = 'rochester_test'; # select a rendering site |
|
|
338 | |
|
|
339 | |
|
|
340 | ############################################################ |
|
|
341 | |
|
|
342 | # To configure the target webwork server |
|
|
343 | # two URLs are required |
|
|
344 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
|
|
345 | # points to the Webservice.pm and Webservice/RenderProblem modules |
|
|
346 | # Is used by the client to send the original XML request to the webservice |
|
|
347 | # |
|
|
348 | # 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml |
|
|
349 | # points to the renderViaXMLRPC.pm module. |
|
|
350 | # |
|
|
351 | # This url is placed as form action url when the rendered HTML from the original |
|
|
352 | # request is returned to the client from Webservice/RenderProblem. The client |
|
|
353 | # reorganizes the XML it receives into an HTML page (with a WeBWorK form) and |
|
|
354 | # pipes it through a local browser. |
|
|
355 | # |
|
|
356 | # The browser uses this url to resubmit the problem (with answers) via the standard |
|
|
357 | # HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler. |
|
|
358 | # |
|
|
359 | # This renderViaXMLRPC.pm handler acts as an intermediary between the browser |
|
|
360 | # and the webservice. It interprets the HTML form sent by the browser, |
|
|
361 | # rewrites the form data in XML format, submits it to the WebworkWebservice.pm |
|
|
362 | # which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm |
|
|
363 | # which in turn passes it back to the browser. |
|
|
364 | # 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form |
|
|
365 | # submitted directly by the browser. |
|
|
366 | # The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice |
|
|
367 | # and returns the result to the browser. |
|
|
368 | # The The client renderProblem.pl script is no longer involved. |
|
|
369 | # 4. Summary: renderProblem.pl is only involved in the first round trip |
|
|
370 | # of the submitted problem. After that the communication is between the browser and |
|
|
371 | # renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm |
|
|
372 | # module using XML_RPC. |
|
|
373 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
|
|
374 | # may be implemented. This is sufficient to keep out robots. |
|
|
375 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
|
|
376 | # result. A different name can be used but the course must exist on the server. |
|
|
377 | >>>>>>> .merge-right.r6936 |
|
|
378 | ======= |
|
|
379 | ############################################################ |
|
|
380 | # configure the local output file and display command !!!!!!!! |
|
|
381 | ############################################################ |
|
|
382 | |
|
|
383 | # Path to a temporary file for storing the output of renderProblem.pl |
|
|
384 | use constant TEMPOUTPUTFILE => '/Users/gage/Desktop/renderProblemOutput.html'; |
|
|
385 | |
|
|
386 | # Command line for displaying the temporary file in a browser. |
|
|
387 | #use constant DISPLAY_COMMAND => 'open -a firefox '; #browser opens tempoutputfile above |
|
|
388 | # use constant DISPLAY_COMMAND => "open -a 'Google Chrome' "; |
|
|
389 | use constant DISPLAY_COMMAND => " less "; # display tempoutputfile with less |
|
|
390 | ############################################################ |
|
|
391 | |
|
|
392 | my $use_site; |
|
|
393 | $use_site = 'test_webwork'; # select a rendering site |
|
|
394 | #$use_site = 'local'; # select a rendering site |
|
|
395 | #$use_site = 'rochester_test'; # select a rendering site |
|
|
396 | |
|
|
397 | |
|
|
398 | ############################################################ |
|
|
399 | |
|
|
400 | # To configure the target webwork server |
|
|
401 | # two URLs are required |
|
|
402 | # 1. $XML_URL http://test.webwork.maa.org/mod_xmlrpc |
|
|
403 | # points to the Webservice.pm and Webservice/RenderProblem modules |
|
|
404 | # Is used by the client to send the original XML request to the webservice |
|
|
405 | # |
|
|
406 | # 2. $FORM_ACTION_URL http:http://test.webwork.maa.org/webwork2/html2xml |
|
|
407 | # points to the renderViaXMLRPC.pm module. |
|
|
408 | # |
|
|
409 | # This url is placed as form action url when the rendered HTML from the original |
|
|
410 | # request is returned to the client from Webservice/RenderProblem. The client |
|
|
411 | # reorganizes the XML it receives into an HTML page (with a WeBWorK form) and |
|
|
412 | # pipes it through a local browser. |
|
|
413 | # |
|
|
414 | # The browser uses this url to resubmit the problem (with answers) via the standard |
|
|
415 | # HTML webform used by WeBWorK to the renderViaXMLRPC.pm handler. |
|
|
416 | # |
|
|
417 | # This renderViaXMLRPC.pm handler acts as an intermediary between the browser |
|
|
418 | # and the webservice. It interprets the HTML form sent by the browser, |
|
|
419 | # rewrites the form data in XML format, submits it to the WebworkWebservice.pm |
|
|
420 | # which processes it and sends the the resulting HTML back to renderViaXMLRPC.pm |
|
|
421 | # which in turn passes it back to the browser. |
|
|
422 | # 3. The second time a problem is submitted renderViaXMLRPC.pm receives the WeBWorK form |
|
|
423 | # submitted directly by the browser. |
|
|
424 | # The renderViaXMLRPC.pm translates the WeBWorK form, has it processes by the webservice |
|
|
425 | # and returns the result to the browser. |
|
|
426 | # The The client renderProblem.pl script is no longer involved. |
|
|
427 | # 4. Summary: renderProblem.pl is only involved in the first round trip |
|
|
428 | # of the submitted problem. After that the communication is between the browser and |
|
|
429 | # renderViaXMLRPC using HTML forms and between renderViaXMLRPC and the WebworkWebservice.pm |
|
|
430 | # module using XML_RPC. |
|
|
431 | # 5. The XML_PASSWORD is defined on the site. In future versions a more secure password method |
|
|
432 | # may be implemented. This is sufficient to keep out robots. |
|
|
433 | # 6. The course "daemon_course" must be a course that has been created on the server or an error will |
|
|
434 | # result. A different name can be used but the course must exist on the server. |
|
|
435 | >>>>>>> .merge-right.r6936 |
| 139 | |
436 | |
|
|
437 | <<<<<<< .working |
|
|
438 | <<<<<<< .working |
|
|
439 | <<<<<<< .working |
| 140 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
440 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
| 141 | |
441 | |
| 142 | |
442 | |
|
|
443 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
|
|
444 | |
|
|
445 | |
|
|
446 | ################################################## |
|
|
447 | ======= |
|
|
448 | |
|
|
449 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
|
|
450 | if ($use_site eq 'local') { |
|
|
451 | # the rest can work!! |
|
|
452 | $XML_URL = 'http://localhost:80'; |
|
|
453 | $FORM_ACTION_URL = 'http://localhost:80/webwork2/html2xml'; |
|
|
454 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
455 | $XML_COURSE = 'daemon_course'; |
|
|
456 | } elsif ($use_site eq 'rochester_test') { |
|
|
457 | |
|
|
458 | $XML_URL = 'http://128.151.231.2'; |
|
|
459 | $FORM_ACTION_URL = 'http://128.151.231.2/webwork2/html2xml'; |
|
|
460 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
461 | $XML_COURSE = 'daemon_course'; |
|
|
462 | |
|
|
463 | } elsif ($use_site eq 'test_webwork') { |
|
|
464 | |
|
|
465 | $XML_URL = 'https://test.webwork.maa.org'; |
|
|
466 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
|
|
467 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
468 | $XML_COURSE = 'daemon_course'; |
|
|
469 | |
|
|
470 | } |
|
|
471 | |
|
|
472 | ################################################## |
|
|
473 | # END configuration section for client |
|
|
474 | ################################################## |
|
|
475 | |
|
|
476 | |
|
|
477 | |
|
|
478 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
|
|
479 | |
|
|
480 | |
|
|
481 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
|
|
482 | |
|
|
483 | |
|
|
484 | ################################################## |
|
|
485 | >>>>>>> .merge-right.r6936 |
|
|
486 | ======= |
|
|
487 | |
|
|
488 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
|
|
489 | if ($use_site eq 'local') { |
|
|
490 | # the rest can work!! |
|
|
491 | $XML_URL = 'http://localhost:80'; |
|
|
492 | $FORM_ACTION_URL = 'http://localhost:80/webwork2/html2xml'; |
|
|
493 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
494 | $XML_COURSE = 'daemon_course'; |
|
|
495 | } elsif ($use_site eq 'rochester_test') { |
|
|
496 | |
|
|
497 | $XML_URL = 'http://128.151.231.2'; |
|
|
498 | $FORM_ACTION_URL = 'http://128.151.231.2/webwork2/html2xml'; |
|
|
499 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
500 | $XML_COURSE = 'daemon_course'; |
|
|
501 | |
|
|
502 | } elsif ($use_site eq 'test_webwork') { |
|
|
503 | |
|
|
504 | $XML_URL = 'https://test.webwork.maa.org'; |
|
|
505 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
|
|
506 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
507 | $XML_COURSE = 'daemon_course'; |
|
|
508 | |
|
|
509 | } |
|
|
510 | |
|
|
511 | ################################################## |
|
|
512 | # END configuration section for client |
|
|
513 | ################################################## |
|
|
514 | |
|
|
515 | |
|
|
516 | |
|
|
517 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
|
|
518 | |
|
|
519 | |
|
|
520 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
|
|
521 | |
|
|
522 | |
|
|
523 | ################################################## |
|
|
524 | >>>>>>> .merge-right.r6936 |
|
|
525 | ======= |
|
|
526 | |
|
|
527 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
|
|
528 | if ($use_site eq 'local') { |
|
|
529 | # the rest can work!! |
|
|
530 | $XML_URL = 'http://localhost:80'; |
|
|
531 | $FORM_ACTION_URL = 'http://localhost:80/webwork2/html2xml'; |
|
|
532 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
533 | $XML_COURSE = 'daemon_course'; |
|
|
534 | } elsif ($use_site eq 'rochester_test') { |
|
|
535 | |
|
|
536 | $XML_URL = 'http://128.151.231.2'; |
|
|
537 | $FORM_ACTION_URL = 'http://128.151.231.2/webwork2/html2xml'; |
|
|
538 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
539 | $XML_COURSE = 'daemon_course'; |
|
|
540 | |
|
|
541 | } elsif ($use_site eq 'test_webwork') { |
|
|
542 | |
|
|
543 | $XML_URL = 'https://test.webwork.maa.org'; |
|
|
544 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
|
|
545 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
546 | $XML_COURSE = 'daemon_course'; |
|
|
547 | |
|
|
548 | } |
|
|
549 | |
|
|
550 | ################################################## |
|
|
551 | # END configuration section for client |
|
|
552 | ################################################## |
|
|
553 | |
|
|
554 | |
|
|
555 | |
|
|
556 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
|
|
557 | |
|
|
558 | |
|
|
559 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
|
|
560 | |
|
|
561 | |
|
|
562 | ################################################## |
|
|
563 | >>>>>>> .merge-right.r6936 |
|
|
564 | # end configuration section |
|
|
565 | <<<<<<< .working |
|
|
566 | <<<<<<< .working |
|
|
567 | <<<<<<< .working |
|
|
568 | >>>>>>> .merge-right.r6936 |
|
|
569 | ################################################## |
|
|
570 | ======= |
|
|
571 | ################################################## |
|
|
572 | >>>>>>> .merge-right.r6936 |
|
|
573 | ======= |
|
|
574 | ################################################## |
|
|
575 | >>>>>>> .merge-right.r6936 |
|
|
576 | ======= |
|
|
577 | ################################################## |
|
|
578 | >>>>>>> .merge-right.r6936 |
|
|
579 | |
|
|
580 | |
|
|
581 | our ( $XML_URL,$FORM_ACTION_URL, $XML_PASSWORD, $XML_COURSE); |
|
|
582 | if ($use_site eq 'local') { |
|
|
583 | # the rest can work!! |
|
|
584 | $XML_URL = 'http://localhost:80'; |
|
|
585 | $FORM_ACTION_URL = 'http://localhost:80/webwork2/html2xml'; |
|
|
586 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
587 | $XML_COURSE = 'daemon_course'; |
|
|
588 | } elsif ($use_site eq 'rochester_test') { |
|
|
589 | |
|
|
590 | $XML_URL = 'http://128.151.231.2'; |
|
|
591 | $FORM_ACTION_URL = 'http://128.151.231.2/webwork2/html2xml'; |
|
|
592 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
593 | $XML_COURSE = 'daemon_course'; |
|
|
594 | |
|
|
595 | } elsif ($use_site eq 'test_webwork') { |
|
|
596 | |
|
|
597 | <<<<<<< .working |
|
|
598 | <<<<<<< .working |
|
|
599 | <<<<<<< .working |
|
|
600 | <<<<<<< .working |
|
|
601 | $XML_URL = 'https://test.webwork.maa.org'; |
|
|
602 | $FORM_ACTION_URL = 'https://test.webwork.maa.org/webwork2/html2xml'; |
|
|
603 | $XML_PASSWORD = 'xmlwebwork'; |
|
|
604 | $XML_COURSE = 'daemon_course'; |
|
|
605 | ======= |
|
|
606 | our $xmlrpc_client = new WebworkClient; |
|
|
607 | |
|
|
608 | ################################################## |
|
|
609 | # input/output section |
|
|
610 | ################################################## |
|
|
611 | |
|
|
612 | |
|
|
613 | ======= |
|
|
614 | our $xmlrpc_client = new WebworkClient; |
|
|
615 | |
|
|
616 | ################################################## |
|
|
617 | # input/output section |
|
|
618 | ################################################## |
|
|
619 | |
|
|
620 | |
|
|
621 | >>>>>>> .merge-right.r6936 |
|
|
622 | ======= |
|
|
623 | our $xmlrpc_client = new WebworkClient; |
|
|
624 | |
|
|
625 | ################################################## |
|
|
626 | # input/output section |
|
|
627 | ################################################## |
|
|
628 | |
|
|
629 | |
|
|
630 | >>>>>>> .merge-right.r6936 |
|
|
631 | ======= |
|
|
632 | our $xmlrpc_client = new WebworkClient; |
|
|
633 | |
|
|
634 | ################################################## |
|
|
635 | # input/output section |
|
|
636 | ################################################## |
|
|
637 | |
|
|
638 | |
|
|
639 | >>>>>>> .merge-right.r6936 |
|
|
640 | our $source; |
|
|
641 | <<<<<<< .working |
|
|
642 | <<<<<<< .working |
|
|
643 | <<<<<<< .working |
|
|
644 | >>>>>>> .merge-right.r6936 |
|
|
645 | our $rh_result; |
|
|
646 | # filter mode main code |
|
|
647 | ======= |
|
|
648 | our $rh_result; |
|
|
649 | # filter mode main code |
|
|
650 | >>>>>>> .merge-right.r6936 |
|
|
651 | ======= |
|
|
652 | our $rh_result; |
|
|
653 | # filter mode main code |
|
|
654 | >>>>>>> .merge-right.r6936 |
|
|
655 | ======= |
|
|
656 | our $rh_result; |
|
|
657 | # filter mode main code |
|
|
658 | >>>>>>> .merge-right.r6936 |
|
|
659 | |
|
|
660 | <<<<<<< .working |
|
|
661 | <<<<<<< .working |
|
|
662 | <<<<<<< .working |
|
|
663 | <<<<<<< .working |
|
|
664 | } |
|
|
665 | |
|
|
666 | ======= |
|
|
667 | >>>>>>> .merge-right.r6936 |
|
|
668 | ======= |
|
|
669 | >>>>>>> .merge-right.r6936 |
|
|
670 | ======= |
|
|
671 | >>>>>>> .merge-right.r6936 |
|
|
672 | ======= |
|
|
673 | >>>>>>> .merge-right.r6936 |
|
|
674 | <<<<<<< .working |
|
|
675 | ################################################## |
|
|
676 | # END configuration section for client |
|
|
677 | ################################################## |
|
|
678 | ======= |
|
|
679 | undef $/; |
|
|
680 | $source = <>; #slurp input |
|
|
681 | $/ =1; |
|
|
682 | <<<<<<< .working |
|
|
683 | <<<<<<< .working |
|
|
684 | <<<<<<< .working |
|
|
685 | $xmlrpc_client->encodeSource($source); |
|
|
686 | $xmlrpc_client->url($XML_URL); |
|
|
687 | $xmlrpc_client->{form_action_url}= $FORM_ACTION_URL; |
|
|
688 | $xmlrpc_client->{displayMode} = DISPLAYMODE(); |
|
|
689 | $xmlrpc_client->{user} = 'xmluser'; |
|
|
690 | $xmlrpc_client->{password} = $XML_PASSWORD; |
|
|
691 | $xmlrpc_client->{course} = $XML_COURSE; |
|
|
692 | >>>>>>> .merge-right.r6936 |
|
|
693 | ======= |
|
|
694 | $xmlrpc_client->encodeSource($source); |
|
|
695 | $xmlrpc_client->url($XML_URL); |
|
|
696 | $xmlrpc_client->{form_action_url}= $FORM_ACTION_URL; |
|
|
697 | $xmlrpc_client->{displayMode} = DISPLAYMODE(); |
|
|
698 | $xmlrpc_client->{user} = 'xmluser'; |
|
|
699 | $xmlrpc_client->{password} = $XML_PASSWORD; |
|
|
700 | $xmlrpc_client->{course} = $XML_COURSE; |
|
|
701 | >>>>>>> .merge-right.r6936 |
|
|
702 | ======= |
|
|
703 | $xmlrpc_client->encodeSource($source); |
|
|
704 | $xmlrpc_client->url($XML_URL); |
|
|
705 | $xmlrpc_client->{form_action_url}= $FORM_ACTION_URL; |
|
|
706 | $xmlrpc_client->{displayMode} = DISPLAYMODE(); |
|
|
707 | $xmlrpc_client->{user} = 'xmluser'; |
|
|
708 | $xmlrpc_client->{password} = $XML_PASSWORD; |
|
|
709 | $xmlrpc_client->{course} = $XML_COURSE; |
|
|
710 | >>>>>>> .merge-right.r6936 |
|
|
711 | ======= |
|
|
712 | $xmlrpc_client->encodeSource($source); |
|
|
713 | $xmlrpc_client->url($XML_URL); |
|
|
714 | $xmlrpc_client->{form_action_url}= $FORM_ACTION_URL; |
|
|
715 | $xmlrpc_client->{displayMode} = DISPLAYMODE(); |
|
|
716 | $xmlrpc_client->{user} = 'xmluser'; |
|
|
717 | $xmlrpc_client->{password} = $XML_PASSWORD; |
|
|
718 | $xmlrpc_client->{course} = $XML_COURSE; |
|
|
719 | >>>>>>> .merge-right.r6936 |
|
|
720 | |
|
|
721 | <<<<<<< .working |
|
|
722 | <<<<<<< .working |
|
|
723 | <<<<<<< .working |
|
|
724 | <<<<<<< .working |
|
|
725 | ======= |
|
|
726 | #xmlrpcCall('renderProblem'); |
|
|
727 | our $output; |
|
|
728 | if ( $xmlrpc_client->xmlrpcCall('renderProblem') ) { |
|
|
729 | $output = "1\n"; |
|
|
730 | $output = pretty_print( $xmlrpc_client->{output} ); |
|
|
731 | } else { |
|
|
732 | $output = "0\n"; |
|
|
733 | $output = $xmlrpc_client->{output}; # error report |
|
|
734 | } |
|
|
735 | >>>>>>> .merge-right.r6936 |
|
|
736 | ======= |
|
|
737 | #xmlrpcCall('renderProblem'); |
|
|
738 | our $output; |
|
|
739 | if ( $xmlrpc_client->xmlrpcCall('renderProblem') ) { |
|
|
740 | $output = "1\n"; |
|
|
741 | $output = pretty_print( $xmlrpc_client->{output} ); |
|
|
742 | } else { |
|
|
743 | $output = "0\n"; |
|
|
744 | $output = $xmlrpc_client->{output}; # error report |
|
|
745 | } |
|
|
746 | >>>>>>> .merge-right.r6936 |
|
|
747 | ======= |
|
|
748 | #xmlrpcCall('renderProblem'); |
|
|
749 | our $output; |
|
|
750 | if ( $xmlrpc_client->xmlrpcCall('renderProblem') ) { |
|
|
751 | $output = "1\n"; |
|
|
752 | $output = pretty_print( $xmlrpc_client->{output} ); |
|
|
753 | } else { |
|
|
754 | $output = "0\n"; |
|
|
755 | $output = $xmlrpc_client->{output}; # error report |
|
|
756 | } |
|
|
757 | >>>>>>> .merge-right.r6936 |
|
|
758 | ======= |
|
|
759 | #xmlrpcCall('renderProblem'); |
|
|
760 | our $output; |
|
|
761 | if ( $xmlrpc_client->xmlrpcCall('renderProblem') ) { |
|
|
762 | $output = "1\n"; |
|
|
763 | $output = pretty_print( $xmlrpc_client->{output} ); |
|
|
764 | } else { |
|
|
765 | $output = "0\n"; |
|
|
766 | $output = $xmlrpc_client->{output}; # error report |
|
|
767 | } |
|
|
768 | >>>>>>> .merge-right.r6936 |
|
|
769 | |
|
|
770 | |
|
|
771 | use constant DISPLAYMODE => 'images'; # jsMath is another possibilities. |
|
|
772 | |
|
|
773 | <<<<<<< .working |
|
|
774 | <<<<<<< .working |
|
|
775 | <<<<<<< .working |
|
|
776 | <<<<<<< .working |
|
|
777 | ======= |
|
|
778 | local(*FH); |
|
|
779 | open(FH, '>'.TEMPOUTPUTFILE) or die "Can't open file ".TEMPOUTPUTFILE()." for writing"; |
|
|
780 | print FH $output; |
|
|
781 | close(FH); |
|
|
782 | >>>>>>> .merge-right.r6936 |
|
|
783 | ======= |
|
|
784 | local(*FH); |
|
|
785 | open(FH, '>'.TEMPOUTPUTFILE) or die "Can't open file ".TEMPOUTPUTFILE()." for writing"; |
|
|
786 | print FH $output; |
|
|
787 | close(FH); |
|
|
788 | >>>>>>> .merge-right.r6936 |
|
|
789 | ======= |
|
|
790 | local(*FH); |
|
|
791 | open(FH, '>'.TEMPOUTPUTFILE) or die "Can't open file ".TEMPOUTPUTFILE()." for writing"; |
|
|
792 | print FH $output; |
|
|
793 | close(FH); |
|
|
794 | >>>>>>> .merge-right.r6936 |
|
|
795 | ======= |
|
|
796 | local(*FH); |
|
|
797 | open(FH, '>'.TEMPOUTPUTFILE) or die "Can't open file ".TEMPOUTPUTFILE()." for writing"; |
|
|
798 | print FH $output; |
|
|
799 | close(FH); |
|
|
800 | >>>>>>> .merge-right.r6936 |
|
|
801 | |
|
|
802 | <<<<<<< .working |
|
|
803 | <<<<<<< .working |
|
|
804 | <<<<<<< .working |
|
|
805 | <<<<<<< .working |
| 143 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
806 | our @COMMANDS = qw( listLibraries renderProblem ); #listLib readFile tex2pdf |
| 144 | |
807 | |
| 145 | |
808 | |
| 146 | ################################################## |
809 | ################################################## |
| 147 | # end configuration section |
810 | # end configuration section |
| … | |
… | |
| 193 | ################################################## |
856 | ################################################## |
| 194 | # end input/output section |
857 | # end input/output section |
| 195 | ################################################## |
858 | ################################################## |
| 196 | |
859 | |
| 197 | sub pretty_print { |
860 | sub pretty_print { |
|
|
861 | ======= |
|
|
862 | system(DISPLAY_COMMAND().TEMPOUTPUTFILE()); |
|
|
863 | |
|
|
864 | ################################################## |
|
|
865 | # end input/output section |
|
|
866 | ################################################## |
|
|
867 | |
|
|
868 | sub pretty_print { |
|
|
869 | >>>>>>> .merge-right.r6936 |
|
|
870 | ======= |
|
|
871 | system(DISPLAY_COMMAND().TEMPOUTPUTFILE()); |
|
|
872 | |
|
|
873 | ################################################## |
|
|
874 | # end input/output section |
|
|
875 | ################################################## |
|
|
876 | |
|
|
877 | sub pretty_print { |
|
|
878 | >>>>>>> .merge-right.r6936 |
|
|
879 | ======= |
|
|
880 | system(DISPLAY_COMMAND().TEMPOUTPUTFILE()); |
|
|
881 | |
|
|
882 | ################################################## |
|
|
883 | # end input/output section |
|
|
884 | ################################################## |
|
|
885 | |
|
|
886 | sub pretty_print { |
|
|
887 | >>>>>>> .merge-right.r6936 |
|
|
888 | ======= |
|
|
889 | system(DISPLAY_COMMAND().TEMPOUTPUTFILE()); |
|
|
890 | |
|
|
891 | ################################################## |
|
|
892 | # end input/output section |
|
|
893 | ################################################## |
|
|
894 | |
|
|
895 | sub pretty_print { |
|
|
896 | >>>>>>> .merge-right.r6936 |
| 198 | shift if UNIVERSAL::isa($_[0] => __PACKAGE__); |
897 | shift if UNIVERSAL::isa($_[0] => __PACKAGE__); |
| 199 | my $rh = shift; |
898 | my $rh = shift; |
| 200 | my $indent = shift || 0; |
899 | my $indent = shift || 0; |
| 201 | my $out = ""; |
900 | my $out = ""; |
| 202 | my $type = ref($rh); |
901 | my $type = ref($rh); |