version 1.67, 2002/09/16 20:38:46
|
version 1.68, 2002/09/18 18:47:04
|
Line 48 use Apache::inputtags;
|
Line 48 use Apache::inputtags;
|
use Apache::grades; |
use Apache::grades; |
use Apache::edit; |
use Apache::edit; |
use Apache::File(); |
use Apache::File(); |
|
use Apache::lonnavmaps; |
use POSIX qw(strftime); |
use POSIX qw(strftime); |
use GDBM_File; |
use GDBM_File; |
|
|
Line 371 ENDPART
|
Line 372 ENDPART
|
#-- where is the primary sequence containing file? |
#-- where is the primary sequence containing file? |
my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'}); |
my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'}); |
$symbolic =~ m/([^_]+)_/; |
$symbolic =~ m/([^_]+)_/; |
my $primary_sequence = '/res/'.$1; |
my $primary_sequence = '/res/'.$1; |
my @master_seq = &coming_from_hash($primary_sequence); |
my @master_seq = &coming_from_hash($primary_sequence); |
#-- produce an output string |
#-- produce an output string |
for (my $i=0;$i<=$#master_seq;$i++) { |
for (my $i=0;$i<=$#master_seq;$i++) { |
my $urlp = $master_seq[$i]; |
my ($urlp,$symb) = split /&&/, $master_seq[$i]; |
if ($choice eq 'Standard LaTeX output for the primary sequence') { |
if ($choice eq 'Standard LaTeX output for the primary sequence') { |
$selectionmade = 2; |
$selectionmade = 2; |
if ($urlp =~ m/\.(problem|exam|quiz|assess|survey|form|library)/) { |
if ($urlp =~ m/\.(problem|exam|quiz|assess|survey|form|library)/) { |
my %moreenv; |
my %moreenv; |
$moreenv{'form.grade_target'}='tex'; |
$moreenv{'form.grade_target'}='tex'; |
&Apache::lonnet::appenv(%moreenv); |
&Apache::lonnet::appenv(%moreenv); |
my $texversion=&Apache::lonnet::ssi($urlp); |
my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb)); |
&Apache::lonnet::delenv('form.grade_target'); |
&Apache::lonnet::delenv('form.grade_target'); |
$result .= $texversion; |
$result .= $texversion; |
} |
} |
Line 556 sub coming_from_hash {
|
Line 557 sub coming_from_hash {
|
|
|
my $mainsequence = shift; |
my $mainsequence = shift; |
my @resourcelist = (); |
my @resourcelist = (); |
|
my $mapid = $hash{'map_pc_'.$mainsequence}; |
my $mapstart = $hash{'map_start_'.$mainsequence}; |
my $mapstart = $hash{'map_start_'.$mainsequence}; |
my $mapfinish = $hash{'map_finish_'.$mainsequence}; |
my $mapfinish = $hash{'map_finish_'.$mainsequence}; |
|
my $symb = &Apache::lonnet::symbread($hash{'src_'.$mapstart}); |
|
$symb = m/^([^___]*)___/; |
|
my $presymb = $1.'___'; |
my $current_resource = $mapstart; |
my $current_resource = $mapstart; |
while ($current_resource ne $mapfinish) { |
while ($current_resource ne $mapfinish) { |
if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
push @resourcelist,$hash{'src_'.$current_resource}; |
my $rid = $hash{'ids_'.$hash{'src_'.$current_resource}}; |
|
if ($rid=~/,/) { |
|
my @rid = split /,/, $rid; |
|
foreach my $rid_element (@rid) { |
|
if ($rid_element =~ m/^$mapid\.(\d*)/) { |
|
$rid = $1; |
|
last; |
|
} |
|
} |
|
} else { |
|
$rid =~ m/^$mapid\.(\d*)/; |
|
$rid = $1; |
|
} |
|
$hash{'src_'.$current_resource} =~ m/\/res\/(.*)$/; |
|
$symb = $presymb.$rid.'___'.$1; |
|
push @resourcelist,$hash{'src_'.$current_resource}.'&&'.$symb; |
} else { |
} else { |
push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
} |
} |
$current_resource = $hash{'goesto_'.$hash{'to_'.$current_resource}}; |
$current_resource = $hash{'goesto_'.$hash{'to_'.$current_resource}}; |
} |
} |
#needs if final resource in the map (type=finish) contains something |
#needs if final resource in the map (type="finish") contains something |
if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
push @resourcelist,$hash{'src_'.$current_resource}; |
my $rid = $hash{'ids_'.$hash{'src_'.$current_resource}}; |
|
if ($rid=~/,/) { |
|
my @rid = split /,/, $rid; |
|
foreach my $rid_element (@rid) { |
|
if ($rid_element =~ m/^$mapid\.(\d*)/) { |
|
$rid = $1; |
|
last; |
|
} |
|
} |
|
} else { |
|
$rid =~ m/^$mapid\.(\d*)/; |
|
$rid = $1; |
|
} |
|
$hash{'src_'.$current_resource} =~ m/\/res\/(.*)$/; |
|
$symb = $presymb.$rid.'___'.$1; |
|
push @resourcelist,$hash{'src_'.$current_resource}.'&&'.$symb; |
} else { |
} else { |
push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
} |
} |
return @resourcelist; |
return @resourcelist; |
} |
} |
|
#sub coming_from_hash { |
|
# |
|
# my $mainsequence = shift; |
|
# my @resourcelist = (); |
|
# my $mapid = $hash{'map_pc_'.$mainsequence}; |
|
# my $mapstart = $hash{'map_start_'.$mainsequence}; |
|
# my $mapfinish = $hash{'map_finish_'.$mainsequence}; |
|
# my $current_resource = $mapstart; |
|
# while ($current_resource ne $mapfinish) { |
|
# if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
|
# push @resourcelist,$hash{'src_'.$current_resource}; |
|
# } else { |
|
# push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
|
# } |
|
# $current_resource = $hash{'goesto_'.$hash{'to_'.$current_resource}}; |
|
# } |
|
# #needs if final resource in the map (type="finish") contains something |
|
# if (not $hash{'src_'.$current_resource}=~/\.sequence$/) { |
|
# push @resourcelist,$hash{'src_'.$current_resource}; |
|
# } else { |
|
# push @resourcelist,&coming_from_hash($hash{'src_'.$current_resource}); |
|
# } |
|
# return @resourcelist; |
|
#} |
|
|
|
|
sub character_chart { |
sub character_chart { |
Line 916 sub additional_cleanup {
|
Line 975 sub additional_cleanup {
|
} |
} |
return $result; |
return $result; |
} |
} |
|
|
|
|
sub page_cleanup { |
sub page_cleanup { |
my $result = shift; |
my $result = shift; |
|
|