--- loncom/interface/lonprintout.pm 2002/03/21 16:15:34 1.18
+++ loncom/interface/lonprintout.pm 2002/03/21 18:46:15 1.19
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.18 2002/03/21 16:15:34 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.19 2002/03/21 18:46:15 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -70,8 +70,8 @@ sub menu_for_output {
Current document
(you will print what you see on the screen)
- Standard LaTeX output for the primary sequence
- All documents from the top level sequence
+ All problems from the primary sequence
+ All problems from the top level sequence
And what page format do you prefer?
CBI
@@ -155,45 +155,27 @@ ENDPART
}
} elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
my @master_seq = ();
- my $keyword = 0;
- my $output_seq = '';
+ my @add_file_seq = ();
#-- where is the main sequence of the course?
my $main_seq = '/res/'.$ENV{'request.course.uri'};
my $file=&Apache::lonnet::filelocation("",$main_seq);
my $filecontents=&Apache::lonnet::getfile($file);
my @file_seq = &content_map($filecontents);
-#-- temporary solution (without sequence inside sequence) - have to be generalized
-
-
-
-
-# if (defined @master_seq) {
-# my $old_value = $#master_seq;
-# my $total_value = $#master_seq + $#file_seq +2;
-# for (my $j=0; $j<=$old_value-$keyword+1; $j++) {
-# $master_seq[$total_value-$j] = $master_seq[$old_value-$j];
-# }
-# for (my $j=0; $j<=$#file_seq; $j++){
-# $master_seq[$keyword+$j] = $file_seq[$j];
-# }
-# @file_seq = ();
-# $keyword = 0;
-# } else {
- @master_seq = @file_seq;
-# @file_seq = ();
-# }
-
-#-- checking wether .sequence file is among the set of files
-# my $current_file = '';
-# for (my $i=0; $i<=$#file_seq; $i++) {
-# $_ = $file_seq[$i];
-# if (m/(.*)\.sequence/) {
-# $current_file = $_;
-# $keyword = $i;
-# last;
-# }
-# }
-
+#-- do we have any other sequence inside?
+ my $i=0;
+ while ($i<=$#file_seq) {
+ $_ = $file_seq[$i];
+ if (/\.sequence$/) {
+ $file = &Apache::lonnet::filelocation("",$file_seq[$i]);
+ $filecontents=&Apache::lonnet::getfile($file);
+ @add_file_seq = &content_map($filecontents);
+ splice(@file_seq,$i,1,@add_file_seq);
+ @add_file_seq = ();
+ $i = -1;
+ }
+ $i++;
+ }
+ @master_seq = @file_seq;
#-- produce an output string
for (my $i=0;$i<=$#master_seq;$i++) {
$_ = $master_seq[$i];