version 1.43, 2002/07/26 18:40:43
|
version 1.46, 2002/08/02 18:27:04
|
Line 79 ENDMENUOUT1
|
Line 79 ENDMENUOUT1
|
<input type="radio" name="choice" value="Standard LaTeX output for the top level sequence"> All problems from the top level sequence<br /> |
<input type="radio" name="choice" value="Standard LaTeX output for the top level sequence"> All problems from the top level sequence<br /> |
<br /> |
<br /> |
ENDMENUOUT2 |
ENDMENUOUT2 |
|
} |
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); |
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); |
$subdirtoprint =~ s/\/[^\/]+$//; |
$subdirtoprint =~ s/\/[^\/]+$//; |
if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') { |
if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') { |
Line 86 ENDMENUOUT2
|
Line 87 ENDMENUOUT2
|
<input type="radio" name="choice" value="Subdirectory print"> All problems from current subdirectory (where this particular problem is)<br /> |
<input type="radio" name="choice" value="Subdirectory print"> All problems from current subdirectory (where this particular problem is)<br /> |
ENDMENUOUT4 |
ENDMENUOUT4 |
} |
} |
} |
|
$r->print(<<ENDMENUOUT5); |
$r->print(<<ENDMENUOUT5); |
<br /><hr /><br /> |
<br /><hr /><br /> |
<h1>And what page format do you prefer?</h1> |
<h1>And what page format do you prefer?</h1> |
Line 98 ENDMENUOUT4
|
Line 98 ENDMENUOUT4
|
</td> |
</td> |
<td> </td> |
<td> </td> |
<td rawspan="2"> |
<td rawspan="2"> |
Number of columns: <input type="text" size="2" name="numberofcolumns" value="2"> |
Number of columns: <select name="numberofcolumns"> |
|
<option selected> 1 </option> |
|
<option> 2 </option> |
|
<option> 3 </option> |
|
<option> 4 </option> |
|
<option> 5 </option> |
|
<option> 6 </option> |
|
<option> 7 </option> |
|
<option> 8 </option> |
|
<option> 9 </option> |
|
</select> |
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
Line 157 ENDPART
|
Line 167 ENDPART
|
my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence); |
my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence); |
my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file); |
my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file); |
my @master_seq = &content_map($sequencefilecontents); |
my @master_seq = &content_map($sequencefilecontents); |
|
# |
|
# for (my $iu=0;$iu<=$#master_seq;$iu++) { |
|
# $result .= ' '.$master_seq[$iu].' '; |
|
# } |
|
# |
#-- produce an output string |
#-- produce an output string |
for (my $i=0;$i<=$#master_seq;$i++) { |
for (my $i=0;$i<=$#master_seq;$i++) { |
$_ = $master_seq[$i]; |
$_ = $master_seq[$i]; |
Line 225 ENDPART
|
Line 240 ENDPART
|
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); |
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); |
$subdirtoprint =~ s/\/[^\/]+$//; |
$subdirtoprint =~ s/\/[^\/]+$//; |
my @list_of_files = (); |
my @list_of_files = (); |
my $localdirectory = $subdirtoprint; |
if ($ENV{'request.role'}=~m/^au\./) { |
$localdirectory =~ s/.*(\/res\/)/$1/; |
$subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//; |
my @content_directory = &Apache::lonnet::dirlist($localdirectory); |
} else { |
|
$subdirtoprint =~ s/.*(\/res\/)/$1/; |
|
} |
|
my @content_directory = (); |
|
if ($ENV{'request.role'}=~m/^au\./) { |
|
@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++) { |
for (my $iy=0;$iy<=$#content_directory;$iy++) { |
my @tempo_array = split(/&/,$content_directory[$iy]); |
my @tempo_array = split(/&/,$content_directory[$iy]); |
$content_directory[$iy] = $tempo_array[0]; |
if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) { |
if ($content_directory[$iy] =~ m/^[^\.]+\.problem$/) { |
push(@list_of_files,$tempo_array[0]); |
push @list_of_files,$content_directory[$iy]; |
|
} |
} |
} |
} |
$localdirectory =~ s/\/$//; |
$subdirtoprint =~ s/\/$//; |
for (my $i=0;$i<=$#list_of_files;$i++) { |
for (my $i=0;$i<=$#list_of_files;$i++) { |
my $urlp = $localdirectory.'/'.$list_of_files[$i]; |
my $urlp = $subdirtoprint.'/'.$list_of_files[$i]; |
my %moreenv; |
my %moreenv; |
$moreenv{'form.grade_target'}='tex'; |
$moreenv{'form.grade_target'}='tex'; |
&Apache::lonnet::appenv(%moreenv); |
&Apache::lonnet::appenv(%moreenv); |
|
if ($ENV{'request.role'}=~m/^au\./) { $urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/; } |
my $texversion=&Apache::lonnet::ssi($urlp); |
my $texversion=&Apache::lonnet::ssi($urlp); |
&Apache::lonnet::delenv('form.grade_target'); |
&Apache::lonnet::delenv('form.grade_target'); |
$texversion =~ s/(\\begin{document})/$1 {\\tiny\\begin{verbatim}$urlp\\end{verbatim}}/; |
$texversion =~ s/(\\begin{document})/$1 {\\tiny\\begin{verbatim}$urlp\\end{verbatim}}/; |
Line 687 sub content_map {
|
Line 710 sub content_map {
|
$_ = $chunk; |
$_ = $chunk; |
m/to=\"(\d+)\"/; |
m/to=\"(\d+)\"/; |
push @number_seq,$1; |
push @number_seq,$1; |
$startlink = index($map_string,'from="'.$1.'"',$startlink); |
$startlink = index($map_string,'from="'.$1.'"',0); |
$startlink = rindex($map_string,'<link ',$startlink); |
$startlink = rindex($map_string,'<link ',$startlink); |
} |
} |
my $stalink = index($map_string,' to="'.$number_seq[0].'"',$startlink); |
my $stalink = index($map_string,' to="'.$number_seq[0].'"',0); |
while ($stalink != -1) { |
while ($stalink != -1) { |
$startlink = rindex($map_string,'<link ',$stalink); |
$startlink = rindex($map_string,'<link ',$stalink); |
$endlink = index($map_string,'</link>',$startlink); |
$endlink = index($map_string,'</link>',$startlink); |