Path to current document: $ENV{'form.postdata'}
+ENDHEADER1
+}
}
sub menu_for_output {
my $r = shift;
+ my ($title_for_single_resource,$title_for_sequence,$title_for_main_map) = &details_for_menu;
+ if ($title_for_single_resource ne '') {$title_for_single_resource = '"'.$title_for_single_resource.'"';}
+ if ($title_for_sequence ne '') {$title_for_sequence = '"'.$title_for_sequence.'"';}
+ if ($title_for_main_map ne '') {$title_for_main_map = '"'.$title_for_main_map.'"';}
+ my $subdir_to_print = $ENV{'form.postdata'};
+ $subdir_to_print =~ m/\/([^\/]+)$/;
+ $subdir_to_print =~ s/$1//;
$r->print(<What do you want to print? Make a choice.
- Current document
-(you will print what you see on the screen)
- All problems from the primary sequence
- The whole primary sequence (problems plus all html and xml files)
- All problems from the top level sequence
-
+ Current document $title_for_single_resource
+(prints what you just saw on the screen)
ENDMENUOUT1
- my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
- $subdirtoprint =~ s/\/[^\/]+$//;
- if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
+ if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {
$r->print(< All problems from current subdirectory (where this particular problem is)
+ All problems from $title_for_sequence
+ All problems plus any pages or html/xml files from $title_for_sequence
ENDMENUOUT2
-}
- $r->print(<print(< All problems in this course (warning: this may be time consuming)
+
+ All problems from $title_for_sequence for selected students
+ENDMENUOUT6
+ }
+ my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
+ $subdirtoprint =~ s/\/[^\/]+$//;
+ if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
+ $r->print(< Problems from current subdirectory $subdir_to_print
+ENDMENUOUT4
+ }
+ $r->print(<
And what page format do you prefer?
+ENDMENUOUT5
+}
+
+
+sub problem_choice_menu {
+ my $r = shift;
+ my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
+ $subdirtoprint =~ s/\/[^\/]+$//;
+ my @list_of_files = ();
+ if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) {
+ $subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//;
+ } else {
+ $subdirtoprint =~ s/.*(\/res\/)/$1/;
+ }
+ my @content_directory = ();
+ if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) {
+ @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
+ } else {
+ @content_directory = &Apache::lonnet::dirlist($subdirtoprint);
+ }
+ for (my $iy=0;$iy<=$#content_directory;$iy++) {
+ my @tempo_array = split(/&/,$content_directory[$iy]);
+ if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) {
+ push(@list_of_files,$tempo_array[0]);
+ }
+ }
+ $subdirtoprint =~ s/\/$//;
+ for (my $i=0;$i<=$#list_of_files;$i++) {
+ $list_of_files[$i] = $subdirtoprint.'/'.$list_of_files[$i];
+ }
+ $r->print(<
+
+
+
+Mark problems which you want to print
+
+
+
+
+ENDMENUOUT1
+ my $i;
+ foreach my $file (@list_of_files) {
+ $r->print('
'.
+ $file);
+ $i++;
+ }
+ $r->print(<
+
+
+
+ENDMENUOUT2
+}
+
+
+sub additional_class_menu {
+ my $r = shift;
+ $r->print(<
+
+
+
+Mark students which assignments you want to print
+ENDMENUOUT1
+ my %courselist=&Apache::lonnet::dump(
+ 'classlist',
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+ my $now=time;
+ $r->print(<
+ function checkall() {
+ for (i=0; i
+
+
+
+
+
+ENDDISHEADER
+ my $i = 0;
+ foreach (sort keys %courselist) {
+ my ($end,$start)=split(/\:/,$courselist{$_});
+ my $active=1;
+ if (($end) && ($now>$end)) { $active=0; }
+ if ($active) {
+ my ($sname,$sdom)=split(/\:/,$_);
+ my %reply=&Apache::lonnet::get('environment',
+ ['firstname','middlename','lastname','generation'],
+ $sdom,$sname);
+ my $section=&Apache::lonnet::usection
+ ($sdom,$sname,$ENV{'request.course.id'});
+ $r->print(
+ '
'.
+ $reply{'firstname'}.' '.
+ $reply{'middlename'}.' '.
+ $reply{'lastname'}.' '.
+ $reply{'generation'}.
+ ' ('.$_.') '.$section);
+ $i++;
+ }
+ }
+ $r->print(<
+
+
+
+ENDMENUOUT2
+}
+
+
+sub additional_print_menu {
+ my $r = shift;
+ my $what_to_print = '';
+ for (my $i=0; $i<$ENV{'form.numberofstudents'};$i++) {
+ $what_to_print .= '';
+ }
+ for (my $i=0; $i<$ENV{'form.numberofproblems'};$i++) {
+ $what_to_print .= '';
+ }
+ $r->print(<
+
+
+
+
+
+Define one column layout parameters:
+Width:
+Height:
+Left margin:
+
+