[system] / trunk / xmlrpc / daemon / Webwork.pm Repository:
ViewVC logotype

Diff of /trunk/xmlrpc/daemon/Webwork.pm

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

Revision 279 Revision 320
1#!/usr/local/bin/perl -w 1#!/usr/local/bin/perl -w
2 2use Safe;
3# Copyright (C) 2001 Michael Gage 3# Copyright (C) 2001 Michael Gage
4 4
5############################################################################### 5###############################################################################
6# The initial code simply initializes variables, defines addresses 6# The initial code simply initializes variables, defines addresses
7# for directories, defines some simple subroutines responders used in debugging 7# for directories, defines some simple subroutines responders used in debugging
12package Webwork; 12package Webwork;
13 13
14use strict; 14use strict;
15use sigtrap; 15use sigtrap;
16use Carp; 16use Carp;
17
17#BEGIN { 18#BEGIN {
18# local $^W=0; 19# local $^W=0;
19# require '/usr/local/lib/perl5/5.6.1/Benchmark.pm'; 20# require '/usr/local/lib/perl5/5.6.1/Benchmark.pm';
20#} 21#}
21print "using the perl version of MIME::Base64\n"; 22print "using the perl version of MIME::Base64\n";
27 28
28use lib "/u/gage/webwork/system/lib/", "/u/gage/webwork/system/courseScripts"; 29use lib "/u/gage/webwork/system/lib/", "/u/gage/webwork/system/courseScripts";
29 30
30############################################################################### 31###############################################################################
31 32
33
32BEGIN{ 34BEGIN{
33 my $GLOBAL_INIT = "/u/gage/webwork/system/lib/Global.pm"; 35 my $GLOBAL_INIT = "/u/gage/webwork/system/lib/Global.pm";
34 print "Opening $GLOBAL_INIT\n"; 36 print "Opening $GLOBAL_INIT\n";
35 require $GLOBAL_INIT or die $GLOBAL_INIT; 37 require $GLOBAL_INIT or die $GLOBAL_INIT;
36 import Global; 38 import Global;
37} 39}
38 40
41
39my $PGTRANSLATOR = "PGtranslator5.pm"; 42my $PGTRANSLATOR = "/u/gage/xmlrpc/daemon/PGtranslator5.pm";
40
41require $PGTRANSLATOR or die "Can't open $PGTRANSLATOR"; 43require $PGTRANSLATOR or die "Can't open $PGTRANSLATOR";
42 44
45
46
43############################################################################### 47###############################################################################
44# List and address myof available problemlibraries 48# List and address of available problemlibraries
45############################################################################### 49###############################################################################
46 50
47 51
48my $libraryPath = '/u/gage/webwork/ww_prob_lib/'; 52my $libraryPath = '/u/gage/webwork/ww_prob_lib/';
49 53
58 62
59############################################################################### 63###############################################################################
60# Configure daemon: 64# Configure daemon:
61############################################################################### 65###############################################################################
62my $courseScriptsDirectory = '/u/gage/webwork/system/courseScripts/'; 66my $courseScriptsDirectory = '/u/gage/webwork/system/courseScripts/';
63my $macroDirectory = '/u/gage/xmlrpc/experiments/macros/'; 67my $macroDirectory = '/ww/webwork/courses/gage_course/templates/macros/';
64my $scriptDirectory = '/u/gage/webwork/system/scripts/'; 68my $scriptDirectory = '/u/gage/webwork/system/scripts/';
65my $templateDirectory = '/u/gage/webwork/ww_prob_lib/'; 69my $templateDirectory = '/ww/webwork/courses/gage_course/templates/';
66 70
67$Global::courseTempDirectory = '/ww/htdocs/tmp/gage_course/'; 71$Global::courseTempDirectory = '/ww/htdocs/tmp/gage_course/';
68$Global::courseTempURL = 'http://webwork-db.math.rochester.edu/tmp/gage_course/'; 72$Global::courseTempURL = 'http://webwork-db.math.rochester.edu/tmp/gage_course/';
69 73
70 74
71$Global::groupID = "webadmin"; 75$Global::groupID = "webwork";
72$Global::numericalGroupID = 1005; 76$Global::numericalGroupID = 1005;
73 77
74my $displayMode = 'HTML'; 78my $displayMode = 'HTML_tth';
75 79
76my $PG_PL = "${courseScriptsDirectory}PG.pl"; 80my $PG_PL = "${courseScriptsDirectory}PG.pl";
77my $DANGEROUS_MACROS_PL = "${courseScriptsDirectory}dangerousMacros.pl"; 81my $DANGEROUS_MACROS_PL = "${courseScriptsDirectory}dangerousMacros.pl";
78my @MODULE_LIST = ( "Exporter", "DynaLoader", "GD", "WWPlot", "Fun", 82my @MODULE_LIST = ( "Exporter", "DynaLoader", "GD", "WWPlot", "Fun",
79 "Circle", "Label", "PGrandom", "Units", "Hermite", 83 "Circle", "Label", "PGrandom", "Units", "Hermite",
80 "List", "Match","Multiple", "Select", "AlgParser", 84 "List", "Match","Multiple", "Select", "AlgParser",
81 "AnswerHash", "Fraction", "VectorField", "Complex1", 85 "AnswerHash", "Fraction", "VectorField", "Complex1",
82 "Complex", "MatrixReal1", "Matrix","Distributions", 86 "Complex", "MatrixReal1", "Matrix","Distributions",
83 "Regression" 87 "Regression"
84 ); 88 );
85my @EXTRA_PACKAGES = ( "AlgParserWithImplicitExpand", "Expr", 89my @EXTRA_PACKAGES = ( "AlgParserWithImplicitExpand", "Expr",
86 "ExprWithImplicitExpand", "AnswerEvaluator", 90 "ExprWithImplicitExpand", "AnswerEvaluator",
87 "AnswerEvaluatorMaker" 91# "AnswerEvaluatorMaker"
88 ); 92 );
89my $INITIAL_MACRO_PACKAGES = <<END_OF_TEXT; 93my $INITIAL_MACRO_PACKAGES = <<END_OF_TEXT;
90 DOCUMENT(); 94 DOCUMENT();
91 loadMacros( 95 loadMacros(
96 "PGcomplexmacros.pl",
92 "PGbasicmacros.pl", 97 "PGbasicmacro.pl",
93 "PGchoicemacros.pl", 98 "PGchoicemacros.pl",
94 "PGanswermacros.pl", 99 "PGanswermacros.pl",
95 "PGnumericalmacros.pl", 100 "PGnumericalmacros.pl",
96 "PGgraphmacros.pl", 101 "PGgraphmacros.pl",
97 "PGauxiliaryFunctions.pl", 102 "PGauxiliaryFunctions.pl",
98 "PGmatrixmacros.pl", 103 "PGmatrixmacros.pl",
99 "PGcomplexmacros.pl",
100 "PGstatisticsmacros.pl" 104 "PGstatisticsmacros.pl"
101 105
102 ); 106 );
103 107
104 ENDDOCUMENT(); 108 ENDDOCUMENT();
105 109
106END_OF_TEXT 110END_OF_TEXT
110############################################################################### 114###############################################################################
111 115
112############################################################################### 116###############################################################################
113############################################################################### 117###############################################################################
114 118
115print "ok so far reading file /u/gage/xmlrpc/daemon/Webwork.pm\n"; 119#print STDERR "ok so far reading file /u/gage/xmlrpc/daemon/Webwork.pm\n";
116 120
117 121
118 122
119############################################################################### 123###############################################################################
120# The following code initializes an instantiation of PGtranslator5 in the 124# The following code initializes an instantiation of PGtranslator5 in the
136 templateDirectory => $templateDirectory, 140 templateDirectory => $templateDirectory,
137 tempDirectory => $Global::courseTempDirectory, 141 tempDirectory => $Global::courseTempDirectory,
138 } 142 }
139); 143);
140$pt -> evaluate_modules( @MODULE_LIST); 144$pt -> evaluate_modules( @MODULE_LIST);
145#print STDERR "Completed loading of modules, now loading extra packages\n";
141$pt -> load_extra_packages( @EXTRA_PACKAGES ); 146$pt -> load_extra_packages( @EXTRA_PACKAGES );
147#print STDERR "Completed loading of packages, now loading environment\n";
142$pt -> environment($dummy_envir); 148$pt -> environment($dummy_envir);
149#print STDERR "Completed loading environment, next initialize\n";
143$pt->initialize(); 150$pt->initialize();
151#print STDERR "Initialized. \n";
144$pt -> unrestricted_load($PG_PL ); 152$pt -> unrestricted_load($PG_PL );
145$pt -> unrestricted_load($DANGEROUS_MACROS_PL); 153$pt -> unrestricted_load($DANGEROUS_MACROS_PL);
146$pt-> set_mask(); 154$pt-> set_mask();
147# 155#
148 156#print STDERR "Unrestricted loads completed.\n";
149 157
150$INITIAL_MACRO_PACKAGES =~ tr /\r/\n/; 158$INITIAL_MACRO_PACKAGES =~ tr /\r/\n/;
151$pt->source_string( $INITIAL_MACRO_PACKAGES ); 159$pt->source_string( $INITIAL_MACRO_PACKAGES );
160#print STDERR "source strings read in\n";
152$pt ->rf_safety_filter( \&safetyFilter); # install blank safety filter 161$pt ->rf_safety_filter( \&safetyFilter); # install blank safety filter
153$pt ->translate(); 162$pt ->translate();
163
164print STDERR "New PGtranslator object inititialization completed.\n";
154################################################################################ 165################################################################################
155## This ends the initialization of the PGtranslator object 166## This ends the initialization of the PGtranslator object
156################################################################################ 167################################################################################
157 168
158############################################################################### 169###############################################################################

Legend:
Removed from v.279  
changed lines
  Added in v.320

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9