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 ($ENV{'form.postdata'}=~/\/res\//) {
+ $r->print(< Problem(s) from $title_for_sequence
+ Problem(s) plus page(s) or html/xml file(s) from $title_for_sequence
+ENDMENUOUT2
+ }
+ if (($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) and ($ENV{'form.postdata'}=~/\/res\//)) {
+ $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') and ($ENV{'form.postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) {
+ $r->print(< Problems from current subdirectory $subdir_to_print
+ENDMENUOUT4
+ }
+ $r->print(<
+And what page format do you prefer?
+
+
+
+ENDMENUOUT5
+}
+
+
+sub sequence_content_menu {
+ my ($key_to,$r) = @_;
+ my $primary_sequence;
+ my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'});
+ my @sequence = split('___',$symbolic);
+ if ($sequence[0]=~/^uploaded/) {$primary_sequence = '/'.$sequence[0];}
+ else {$primary_sequence = '/res/'.$sequence[0];}
+ my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]);
+ my @master_seq_view = @master_seq;
+ @master_seq = @master_seq;
+ for (my $i=0;$i<=$#master_seq_view;$i++) {
+ $master_seq_view[$i]=~/\/([^\/]+)$/;
+ $master_seq_view[$i]=$1;
+ }
+ $r->print(<
+
+
+
+
+
+Mark item(s) which you want to print
+
+
+
+
+ENDMENUOUT1
+ my $inc=0;
+ for (my $i=0;$i<=$#master_seq_view;$i++) {
+ if ($key_to==1 && $master_seq_view[$i]=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
+ $r->print('
'."\n".
+ $master_seq_view[$i]);
+ $inc++;
+ } elsif ($key_to==0 && $master_seq_view[$i]=~/\.(problem|exam|quiz|assess|survey|form|library|xml|htm|html|page)$/) {
+ $r->print('
'.
+ $master_seq_view[$i]);
+ $inc++;
+ }
+ }
+ $r->print(<
+
+
+
+ENDMENUOUT2
+
+}
+
+
+sub problem_choice_menu {
+ my $r = shift;
+ my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
+ $subdirtoprint =~ s/\/[^\/]+$//;
+ my @list_of_files = ();
+ my @content_directory = ();
+ if ($subdirtoprint =~ m|/home/([^/]+)/public_html|) {
+ #localmachine CSTR space
+ my $user=$1;
+ my $domain=$Apache::lonnet::perlvar{'lonDefDomain'};
+ @content_directory = &Apache::lonnet::dirlist($subdirtoprint,
+ $domain, $user,'');
+ } 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=0;
+ foreach my $file (sort @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(<Number of blank pages to add:
+
+
+
+
+
+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 .= '';
+ }
+ for (my $i=0; $i<$ENV{'form.numberoffiles'};$i++) {
+ $what_to_print .= '';
+ }
+ $r->print(<
+
+
+
+
+
+
+
+
+
+Define one column layout parameters:
+Width:
+Height:
+Left margin:
+
+