[system] / trunk / webwork / system / courseScripts / dangerousMacros.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/courseScripts/dangerousMacros.pl

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

Revision 29 Revision 30
212 # be the same. 212 # be the same.
213 ############################################################################### 213 ###############################################################################
214 214
215 local($temp::rf_init_subroutine); 215 local($temp::rf_init_subroutine);
216 eval qq{ \$temp::rf_init_subroutine = \\&main::$init_subroutine_name;}; 216 eval qq{ \$temp::rf_init_subroutine = \\&main::$init_subroutine_name;};
217 217 #print "defining \$temp::rf_init_subroutine",$temp::rf_init_subroutine;
218
219
220
221 218
222 $macro_file_loaded = defined($temp::rf_init_subroutine) && defined( &{$temp::rf_init_subroutine} ); 219 $macro_file_loaded = defined($temp::rf_init_subroutine) && defined( &{$temp::rf_init_subroutine} );
223 220
224 # macros are searched for first in the $macroDirectory of the course 221 # macros are searched for first in the $macroDirectory of the course
225 # and then in the webwork $courseScripts directory. 222 # and then in the webwork $courseScripts directory.
232 compile_file("${main::courseScriptsDirectory}$fileName"); 229 compile_file("${main::courseScriptsDirectory}$fileName");
233 } else { 230 } else {
234 die "Can't locate macro file via path: |${main::macroDirectory}$fileName| or |${main::courseScriptsDirectory}$fileName|"; 231 die "Can't locate macro file via path: |${main::macroDirectory}$fileName| or |${main::courseScriptsDirectory}$fileName|";
235 } 232 }
236 } 233 }
234 # Try again to define the initialization subroutine.
235 eval qq{ \$temp::rf_init_subroutine = \\&main::$init_subroutine_name;};
236 #print "defining \$temp::rf_init_subroutine",$temp::rf_init_subroutine;
237
237 if ( defined($temp::rf_init_subroutine) and defined( &{$temp::rf_init_subroutine} ) ) { 238 if ( defined($temp::rf_init_subroutine) and defined( &{$temp::rf_init_subroutine} ) ) {
238 #print " &$init_subroutine_name defined = ", $macro_file_loaded,"\n"; 239 #print " &$init_subroutine_name defined = ", $macro_file_loaded,"\n";
239 &{$temp::rf_init_subroutine}(); #initialize file 240 &{$temp::rf_init_subroutine}(); #initialize file
240 #print "initializing $init_subroutine_name\n"; 241 #print "initializing $init_subroutine_name\n";
241 } 242 }

Legend:
Removed from v.29  
changed lines
  Added in v.30

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9