[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Thu, 15 May 2003 14:16:47 -0000
sakharuk Thu May 15 10:16:47 2003 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
All possible variants for printing problems with answers are available now.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.173 loncom/interface/lonprintout.pm:1.174
--- loncom/interface/lonprintout.pm:1.173 Thu May 15 09:32:02 2003
+++ loncom/interface/lonprintout.pm Thu May 15 10:16:47 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.173 2003/05/15 13:32:02 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.174 2003/05/15 14:16:47 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1041,6 +1041,8 @@
sub page_format {
my ($papersize,$layout,$numberofcolumns) = @_;
my ($textwidth,$textheight,$oddoffset,$evenoffset) = (0,0,0,0);
+
+
if ($papersize=~/Letter/) {
if ($layout eq 'CAPA') {
if ($numberofcolumns == 1) {
@@ -1524,6 +1526,16 @@
$urlp =~ s|^/home/httpd/html||;
}
my $texversion=&Apache::lonnet::ssi($urlp,%form);
+ if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
+ my $rndseed=time;
+ $form{'rndseed'}=$rndseed;
+ my %form;
+ $form{'grade_target'}='answer';
+ $form{'answer_output_mode'}='tex';
+ $form{'rndseed'}=$rndseed;
+ my $answer=&Apache::lonnet::ssi($urlp,%form);
+ $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
+ }
#this chunck is responsible for printing the path to problem
my $newurlp = '';
my $HowMany = length($urlp)*2;