[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Wed, 01 Oct 2003 19:51:32 -0000
sakharuk Wed Oct 1 15:51:32 2003 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Can print the sequence of only answers for the sequence of problems, sequence of resources (needs better test), any set of problems from the course (again, needs better test).
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.245 loncom/interface/lonprintout.pm:1.246
--- loncom/interface/lonprintout.pm:1.245 Wed Oct 1 09:49:41 2003
+++ loncom/interface/lonprintout.pm Wed Oct 1 15:51:31 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.245 2003/10/01 13:49:41 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.246 2003/10/01 19:51:31 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -861,6 +861,7 @@
$form{'symb'}=$master_seq[$i];
my ($sequence)=&Apache::lonnet::decode_symb($master_seq[$i]);
my $assignment=&Apache::lonxml::latex_special_symbols(&Apache::lonnet::gettitle($sequence),'header'); #tittle of the assignment which contains this problem
+ my $texversion='';
#&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]");
my $texversion=&Apache::lonnet::ssi($urlp,%form);
if ($urlp=~/\.page$/) {
@@ -869,17 +870,25 @@
$texversion =~ s/\\end{document}\d*/\\end{document}/;
$flag_page_in_sequence = 'YES';
}
- if ($flag_latex_header_remove ne 'NO') {
- $texversion = &latex_header_footer_remove($texversion);
- } else {
- $texversion =~ s/\\end{document}//;
- }
- if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
+ if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
+ ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
my %form;
$form{'grade_target'}='answer';
$form{'answer_output_mode'}='tex';
my $answer=&Apache::lonnet::ssi($urlp,%form);
- $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
+ if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
+ $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
+ } else {
+ $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+ $texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm ';
+ $texversion.=&path_to_problem ($urlp,$LaTeXwidth);
+ $texversion.='\vskip 1 mm '.$answer;
+ }
+ }
+ if ($flag_latex_header_remove ne 'NO') {
+ $texversion = &latex_header_footer_remove($texversion);
+ } else {
+ $texversion =~ s/\\end{document}//;
}
if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') {
$texversion=&IndexCreation($texversion,$urlp);