| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/PG.pm,v 1.54 2004/06/23 01:19:56 sh002i Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/PG.pm,v 1.55 2004/06/26 21:07:20 jj Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 167 | |
167 | |
| 168 | # ---------------------------------------------------------------------- |
168 | # ---------------------------------------------------------------------- |
| 169 | |
169 | |
| 170 | my $basename = "equation-$envir{psvn}.$envir{probNum}"; |
170 | my $basename = "equation-$envir{psvn}.$envir{probNum}"; |
| 171 | $basename .= ".$envir{problemSeed}" if $envir{problemSeed}; |
171 | $basename .= ".$envir{problemSeed}" if $envir{problemSeed}; |
| 172 | |
172 | |
|
|
173 | # to make grabbing these options easier, we'll pull them out now... |
|
|
174 | my %imagesModeOptions = %{$ce->{pg}->{displayModeOptions}->{images}}; |
|
|
175 | |
| 173 | # Object for generating equation images |
176 | # Object for generating equation images |
| 174 | $envir{imagegen} = WeBWorK::PG::ImageGenerator->new( |
177 | $envir{imagegen} = WeBWorK::PG::ImageGenerator->new( |
| 175 | tempDir => $ce->{webworkDirs}->{tmp}, # global temp dir |
178 | tempDir => $ce->{webworkDirs}->{tmp}, # global temp dir |
| 176 | latex => $envir{externalLaTeXPath}, |
179 | latex => $envir{externalLaTeXPath}, |
| 177 | dvipng => $envir{externalDvipngPath}, |
180 | dvipng => $envir{externalDvipngPath}, |
| 178 | useCache => 1, |
181 | useCache => 1, |
| 179 | cacheDir => $ce->{webworkDirs}->{equationCache}, |
182 | cacheDir => $ce->{webworkDirs}->{equationCache}, |
| 180 | cacheURL => $ce->{webworkURLs}->{equationCache}, |
183 | cacheURL => $ce->{webworkURLs}->{equationCache}, |
| 181 | cacheDB => $ce->{webworkFiles}->{equationCacheDB}, |
184 | cacheDB => $ce->{webworkFiles}->{equationCacheDB}, |
| 182 | useMarkers => ($ce->{pg}->{renderers}->{dvipng_align} && |
185 | useMarkers => ($imagesModeOptions{dvipng_align} && $imagesModeOptions{dvipng_align} eq 'mysql'), |
| 183 | $ce->{pg}->{renderers}->{dvipng_align} eq 'mysql'), |
186 | dvipng_align => $imagesModeOptions{dvipng_align}, |
| 184 | dvipng_align => $ce->{pg}->{renderers}->{dvipng_align}, |
187 | dvipng_depth_db => $imagesModeOptions{dvipng_depth_db}, |
| 185 | dvipng_depth_db => $ce->{pg}->{renderers}->{dvipng_depth_db}, |
|
|
| 186 | ); |
188 | ); |
| 187 | |
189 | |
| 188 | # Other things... |
190 | # Other things... |
| 189 | $envir{QUIZ_PREFIX} = $options->{QUIZ_PREFIX}; # used by quizzes |
191 | $envir{QUIZ_PREFIX} = $options->{QUIZ_PREFIX}; # used by quizzes |
| 190 | $envir{PROBLEM_GRADER_TO_USE} = $ce->{pg}->{options}->{grader}; |
192 | $envir{PROBLEM_GRADER_TO_USE} = $ce->{pg}->{options}->{grader}; |