[system] / trunk / webwork / system / cgi / cgi-scripts / welcomeAction.pl Repository:
ViewVC logotype

Diff of /trunk/webwork/system/cgi/cgi-scripts/welcomeAction.pl

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

Revision 115 Revision 116
4################################################################ 4################################################################
5# Copyright @1995-1999 by Michael E. Gage, Arnold K. Pizer and 5# Copyright @1995-1999 by Michael E. Gage, Arnold K. Pizer and
6# WeBWorK at the University of Rochester. All rights reserved. 6# WeBWorK at the University of Rochester. All rights reserved.
7################################################################ 7################################################################
8 8
9my $debugON=0; ## set this to 1 to save debugging information for errors in hardcopy output 9my $debugON=1; ## set this to 1 to save debugging information for errors in hardcopy output
10 10
11use lib '.'; use webworkInit; # WeBWorKInitLine 11use lib '.'; use webworkInit; # WeBWorKInitLine
12require 5.001; 12require 5.001;
13 13
14$/ ="\n"; 14$/ ="\n";
565 my ($cumulativeTexSource, $currentTexSourceRef, $currentTexSource, $currentTexErrorRef); 565 my ($cumulativeTexSource, $currentTexSourceRef, $currentTexSource, $currentTexErrorRef);
566 566
567 # this could be used when eliminating pre-foreach createTexSourceHandleErrors call 567 # this could be used when eliminating pre-foreach createTexSourceHandleErrors call
568 # s/\\end\{document\}.*?\\begin\{document\}/\n\\newpage\n/s; 568 # s/\\end\{document\}.*?\\begin\{document\}/\n\\newpage\n/s;
569 569
570 $tempTexFileBaseName = "$tempDirectory$User\_$Course"; 570 $tempTexFileBaseName = "${tempDirectory}Temp_downloadAllSets_$User";
571 my $first_psvn = $psvns_to_download[0]; 571 my $first_psvn = $psvns_to_download[0];
572 572
573 my $current_psvn = shift @psvns_to_download; 573 my $current_psvn = shift @psvns_to_download;
574 ($currentTexSourceRef, $currentTexErrorRef) = createTexSource($current_psvn); 574 ($currentTexSourceRef, $currentTexErrorRef) = createTexSource($current_psvn);
575 @psvns_to_download = () if(@$currentTexErrorRef); 575 @psvns_to_download = () if(@$currentTexErrorRef);
634 my ($texFileBaseName, $targetFormat) = @_; 634 my ($texFileBaseName, $targetFormat) = @_;
635 my $mimeType; 635 my $mimeType;
636 636
637 chdir $tempDirectory; 637 chdir $tempDirectory;
638 638
639 my $dviCommandLine = "$Global::$Global::externalLatexPath $texFileBaseName.tex >/dev/null 2>/dev/null"; 639 my $dviCommandLine = "$Global::externalLatexPath $texFileBaseName.tex >/dev/null 2>/dev/null";
640 my $psCommandLine = "$Global::externalDvipsPath -o $texFileBaseName.ps $texFileBaseName.dvi >/dev/null 2>/dev/null"; 640 my $psCommandLine = "$Global::externalDvipsPath -o $texFileBaseName.ps $texFileBaseName.dvi >/dev/null 2>/dev/null";
641 my $pdfCommandLine = "$Global::externalPs2pdfPath $texFileBaseName.ps $texFileBaseName.pdf"; 641 my $pdfCommandLine = "$Global::externalPs2pdfPath $texFileBaseName.ps $texFileBaseName.pdf";
642 642
643 if($targetFormat eq "pdf") { 643 if($targetFormat eq "pdf") {
644 system($dviCommandLine) and die "dvi generation failed."; 644 system($dviCommandLine); -e "$texFileBaseName.dvi" or die "dvi generation failed.";
645 system($psCommandLine) and die "ps generation failed."; 645 system($psCommandLine); -e "$texFileBaseName.ps" or die "ps generation failed.";
646 system($pdfCommandLine) and die "pdf generation failed."; 646 system($pdfCommandLine); -e "$texFileBaseName.pdf" or die "pdf generation failed.";
647 $mimeType = "application/pdf"; 647 $mimeType = "application/pdf";
648 } elsif($targetFormat eq "ps") { 648 } elsif($targetFormat eq "ps") {
649 system($dviCommandLine) and die "dvi generation failed."; 649 system($dviCommandLine); -e "$texFileBaseName.dvi" or die "dvi generation failed.";
650 system($psCommandLine) and die "ps generation failed."; 650 system($psCommandLine); -e "$texFileBaseName.ps" or die "ps generation failed.";
651 $mimeType = "application/postscript"; 651 $mimeType = "application/postscript";
652 } elsif($targetFormat eq "dvi") { 652 } elsif($targetFormat eq "dvi") {
653 system($dviCommandLine) and die "dvi generation failed."; 653 system($dviCommandLine); -e "$texFileBaseName.dvi" or die "dvi generation failed.";
654 $mimeType = "application/x-dvi"; 654 $mimeType = "application/x-dvi";
655 } elsif($targetFormat eq "tex") { 655 } elsif($targetFormat eq "tex") {
656 $mimeType = "application/tex"; 656 $mimeType = "application/tex";
657 } else { 657 } else {
658 die "unrecognized format: $targetFormat"; 658 die "unrecognized format: $targetFormat";

Legend:
Removed from v.115  
changed lines
  Added in v.116

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9