[system] / trunk / pg / macros / displayMacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/displayMacros.pl

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

Revision 1765 Revision 2274
356 356
357 } 357 }
358 358
359 359
360 open(TEXXX, "${PROBDIR}${psvn}output.html") or 360 open(TEXXX, "${PROBDIR}${psvn}output.html") or
361 wwerror("ERROR: $0", "Can't open ${PROBDIR}${psvn}output.html",'','', ''); 361 die "ERROR: $0 Can't open ${PROBDIR}${psvn}output.html";
362 @printlines = <TEXXX>; 362 @printlines = <TEXXX>;
363 close(TEXXX); 363 close(TEXXX);
364# } else { 364# } else {
365# 365#
366# @printlines="createDisplayedProblem: Error: Mode is not HTML, HTML_tthHTML_tth or Latex2HTML."; 366# @printlines="createDisplayedProblem: Error: Mode is not HTML, HTML_tthHTML_tth or Latex2HTML.";
404 my $PROBURL = &getCoursel2hURL."set$setNumber/$probNum-$psvn/"; 404 my $PROBURL = &getCoursel2hURL."set$setNumber/$probNum-$psvn/";
405 405
406 &createDirectory($TMPPROBDIR,$Global::l2h_prob_directory_permission,$Global::numericalGroupID) 406 &createDirectory($TMPPROBDIR,$Global::l2h_prob_directory_permission,$Global::numericalGroupID)
407 unless(-e "$TMPPROBDIR"); 407 unless(-e "$TMPPROBDIR");
408 408
409 open(OUTTEXFILE, ">$TMPPROBDIR${psvn}output.tex") or wwerror($0, "Can't open temporary file $TMPPROBDIR${psvn}output.tex"); 409 open(OUTTEXFILE, ">$TMPPROBDIR${psvn}output.tex") or die "Can't open temporary file $TMPPROBDIR${psvn}output.tex";
410 410
411 print OUTTEXFILE &texInput($Global::TEX_PROB_PREAMBLE); 411 print OUTTEXFILE &texInput($Global::TEX_PROB_PREAMBLE);
412 print OUTTEXFILE &texInput($Global::TEX_PROB_HEADER); 412 print OUTTEXFILE &texInput($Global::TEX_PROB_HEADER);
413 print OUTTEXFILE @$printlinesref; 413 print OUTTEXFILE @$printlinesref;
414 print OUTTEXFILE &texInput($Global::TEX_PROB_FOOTER); 414 print OUTTEXFILE &texInput($Global::TEX_PROB_FOOTER);
446 446
447 } 447 }
448 448
449 close(TEXORG); 449 close(TEXORG);
450 open(TEXNEW, ">${TMPPROBDIR}${psvn}output.html") or 450 open(TEXNEW, ">${TMPPROBDIR}${psvn}output.html") or
451 wwerror($0, "Can't open ${TMPPROBDIR}${psvn}output.html",'','', ''); 451 die "Can't open ${TMPPROBDIR}${psvn}output.html";
452 452
453 453
454 foreach (@l2hOutputArray) { 454 foreach (@l2hOutputArray) {
455 if($_ =~ /^<META/) {next;} 455 if($_ =~ /^<META/) {next;}
456 if($_ =~ /^<!DOCTYPE HTML PUBLIC/) {next;} 456 if($_ =~ /^<!DOCTYPE HTML PUBLIC/) {next;}
471 close(TEXNEW); 471 close(TEXNEW);
472 472
473 ## Now do global multiline changes on whole file 473 ## Now do global multiline changes on whole file
474 474
475 open(TEXNEW, "${TMPPROBDIR}${psvn}output.html") or 475 open(TEXNEW, "${TMPPROBDIR}${psvn}output.html") or
476 wwerror("$0", "Can't open ${TMPPROBDIR}${psvn}output.html",'','', ''); 476 die "Can't open ${TMPPROBDIR}${psvn}output.html";
477 @l2hOutputArray = <TEXNEW>; 477 @l2hOutputArray = <TEXNEW>;
478 close(TEXNEW); 478 close(TEXNEW);
479 my $l2hOutputString = join('',@l2hOutputArray); 479 my $l2hOutputString = join('',@l2hOutputArray);
480 480
481 ## make gif images created by latex2html locatable by server 481 ## make gif images created by latex2html locatable by server
487 487
488 ## remove multiline comments 488 ## remove multiline comments
489 $l2hOutputString =~ s|<!--.*?-->\n||sg; 489 $l2hOutputString =~ s|<!--.*?-->\n||sg;
490 490
491 open(TEXNEW, ">${TMPPROBDIR}${psvn}output.html") or 491 open(TEXNEW, ">${TMPPROBDIR}${psvn}output.html") or
492 wwerror("$0", "Can't open ${TMPPROBDIR}${psvn}output.html",'','', ''); 492 die "Can't open ${TMPPROBDIR}${psvn}output.html";
493 print TEXNEW $l2hOutputString; 493 print TEXNEW $l2hOutputString;
494 close(TEXNEW); 494 close(TEXNEW);
495 495
496 ## remove unneeded files 496 ## remove unneeded files
497 497

Legend:
Removed from v.1765  
changed lines
  Added in v.2274

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9