Path to current document: $ENV{'form.postdata'}
+ENDHEADER1
+}
}
sub menu_for_output {
my $r = shift;
- $r->print(<print(<What do you want to print? Make a choice.
- Standard LaTeX output for current document
- Standard LaTeX output for the primary sequence
- Standard LaTeX output for the top level sequence
-
+ Current document $title_for_single_resource
+(prints what you just saw on the screen)
+ENDMENUOUT1
+ if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {
+ $r->print(< All problems from $title_for_sequence
+ All problems plus any pages or html/xml files from $title_for_sequence
+ENDMENUOUT2
+ }
+ if ($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) {
+ $r->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(<
+
+
+
+Select student(s) whose assignment 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:
+
+