| … | |
… | |
| 11 | ############################################################################### |
11 | ############################################################################### |
| 12 | |
12 | |
| 13 | use strict; |
13 | use strict; |
| 14 | use sigtrap; |
14 | use sigtrap; |
| 15 | use Carp; |
15 | use Carp; |
| 16 | |
16 | use lib '/u/gage/xmlrpc/lib'; |
| 17 | |
17 | use lib '/u/gage/webwork/system/courseScripts'; |
| 18 | |
18 | |
| 19 | use Webwork; |
19 | use Webwork; |
|
|
20 | use MathTranslators; |
|
|
21 | use FetchLibraryProblems; |
| 20 | use Frontier::Daemon_ww; |
22 | use Frontier::Daemon_ww; |
|
|
23 | |
|
|
24 | # hacked configuration variables relating to dvipng support |
|
|
25 | |
|
|
26 | # $Global::externalLatexPath |
|
|
27 | |
|
|
28 | # dvipng is used for dpng mode |
|
|
29 | $Global::externalDvipngPath = "/usr/local/bin/dvipng"; |
|
|
30 | |
|
|
31 | # These two have to match, from modes.mf |
|
|
32 | $Global::dvipngMode = "toshiba"; |
|
|
33 | $Global::dvipngDPI = 180; |
|
|
34 | |
|
|
35 | # Adjusting shrink factor produces better results than adjusting Resolution |
|
|
36 | # Resolution can have fractional values, like 1.3 whereas ShrinkFactor must |
|
|
37 | # be an integer. The size of the output is proportional to |
|
|
38 | # DPI * Scaling / ShrinkFactor |
|
|
39 | |
|
|
40 | $Global::dvipngShrinkFactor = 6; # reasonable for toshiba |
|
|
41 | $Global::dvipngScaling = 4.0; # reasonable for toshiba |
|
|
42 | |
|
|
43 | # latex2html is used for the typeset display mode. WeBWorK supports version 96.1 |
|
|
44 | # and version 98.1p1 (or later). Specify either 96.1 or 98.1p1 for |
|
|
45 | # $externalLaTeX2HTMLVersion -- this will effect the syntax used when calling |
|
|
46 | # latex2html. $externalLaTeX2HTMLInit should point to a latex2html init file |
|
|
47 | # that matches the version of latex2html specified. |
|
|
48 | $Global::externalLaTeX2HTMLPath = "/usr/local/bin/latex2html"; |
|
|
49 | $Global::externalLaTeX2HTMLVersion = "98.1p1"; |
|
|
50 | $Global::externalLaTeX2HTMLInit = "/u/gage/webwork/system/lib/latex2html.init.$Global::externalLaTeX2HTMLVersion"; |
|
|
51 | |
|
|
52 | # latex, dvips, and gs are programs used to generate problem set hard copy |
|
|
53 | # output in various formats (DVI, PostScript, PDF). |
|
|
54 | $Global::externalLatexPath = "/usr/local/bin/latex"; |
|
|
55 | $Global::externalDvipsPath = "/usr/local/bin/dvips"; |
|
|
56 | $Global::externalGsPath = "/usr/local/bin/gs"; |
|
|
57 | |
|
|
58 | # Finally some of the above programs may call other programs (e.g. dvips |
|
|
59 | # calls mktexpk to generate missing fonts). The locations of these other |
|
|
60 | # programs must be listed in Perl's $ENV{PATH} variable. The path listed in |
|
|
61 | # $extendedPath is appended to Perl's $ENV{PATH}. Setting |
|
|
62 | # $extendedPath = ':/usr/bin:/usr/local/bin' should work in almost all cases |
|
|
63 | # and $extendedPath = ':/usr/local/bin' should work in most. You may have to |
|
|
64 | # edit this depending on where these programs are found on your system. If you |
|
|
65 | # have problems, check .../webwork/system/logs/error_log for messages about programs |
|
|
66 | # which were not found. |
|
|
67 | $Global::extendedPath = ':/usr/bin:/usr/local/bin'; |
|
|
68 | |
|
|
69 | # The rendering modes for onscreen problem display which are available to the student. |
|
|
70 | # Modes can be added, or commented out here. Adding a new mode required additional changes. |
|
|
71 | # The format is [internal symbol, external name]. |
|
|
72 | $Global::available_mode_list = [ |
|
|
73 | ['HTML', 'text'], |
|
|
74 | ['HTML_tth', 'formatted-text'], |
|
|
75 | ['HTML_dpng' ,'typeset2'], |
|
|
76 | ['Latex2HTML', 'typeset'] |
|
|
77 | ]; |
|
|
78 | |
| 21 | |
79 | |
| 22 | ############################################################################### |
80 | ############################################################################### |
| 23 | # This sections starts up the WeBWorK daemon at http://webwork-db.math.rochester.edu:8005/ |
81 | # This sections starts up the WeBWorK daemon at http://webwork-db.math.rochester.edu:8005/ |
| 24 | ############################################################################### |
82 | ############################################################################### |
| 25 | my $PORT = 8089; |
83 | my $PORT = 8088; |
| 26 | print "starting daemon on port $PORT\n"; |
84 | print "starting daemon on port $PORT\n"; |
| 27 | new Frontier::Daemon_ww( |
85 | new Frontier::Daemon_ww( |
| 28 | LocalPort => $PORT, |
86 | LocalPort => $PORT, |
| 29 | methods => { |
87 | methods => { |
| 30 | 'echo' => \&Webwork::echo, |
88 | 'echo' => \&Webwork::echo, |
| 31 | 'echo2' => \&Webwork::echo2, |
89 | 'echo2' => \&Webwork::echo2, |
| 32 | 'renderProblem' => \&Webwork::renderProblem, |
90 | 'renderProblem' => \&Webwork::renderProblem, |
| 33 | 'readFile' => \&Webwork::readFile, |
91 | 'readFile' => \&FetchLibraryProblems::readFile, |
| 34 | 'listLib' => \&Webwork::listLib, |
92 | 'listLib' => \&FetchLibraryProblems::listLib, |
| 35 | 'tex2pdf' => \&Webwork::tex2pdf, |
93 | 'tex2pdf' => \&MathTranslators::tex2pdf, |
| 36 | 'quit' => \&Webwork::xmlquit, |
94 | 'quit' => \&Webwork::xmlquit, |
| 37 | 'hello' => \&Webwork::hello |
95 | 'hello' => \&Webwork::hello |
| 38 | |
96 | |
| 39 | }); |
97 | }); |
| 40 | |
98 | |