version 1.54, 2004/01/16 15:33:40
|
version 1.55, 2004/01/16 15:35:04
|
Line 1562 sub ProblemSelector {
|
Line 1562 sub ProblemSelector {
|
######################################################### |
######################################################### |
sub get_problem_symb { |
sub get_problem_symb { |
my $problemstring = shift(); |
my $problemstring = shift(); |
&Apache::lonnet::logthis('problemstring = '.$problemstring); |
|
my ($symb,$partid,$respid,$resptype) = split(':',$problemstring); |
my ($symb,$partid,$respid,$resptype) = split(':',$problemstring); |
&Apache::lonnet::logthis("\n". |
|
join(" --- \n",split(':',$problemstring))); |
|
return ({ symb => $symb, |
return ({ symb => $symb, |
part => $partid, |
part => $partid, |
respid => $respid, |
respid => $respid, |
Line 1586 sub get_resource_from_symb {
|
Line 1583 sub get_resource_from_symb {
|
|
|
sub get_prev_curr_next { |
sub get_prev_curr_next { |
my ($target) = @_; |
my ($target) = @_; |
while(my($k,$v) = each(%$target)) { |
|
&Apache::lonnet::logthis($k.' = '.$v); |
|
} |
|
# |
# |
# Build an array with the data we need to search through |
# Build an array with the data we need to search through |
my @Resource; |
my @Resource; |
Line 1613 sub get_prev_curr_next {
|
Line 1607 sub get_prev_curr_next {
|
} |
} |
} |
} |
# |
# |
&Apache::lonnet::logthis('size of @Resource = '.scalar(@Resource)); |
|
# |
# |
# Get the index of the current situation |
# Get the index of the current situation |
my $curr_idx; |
my $curr_idx; |
for ($curr_idx=0;$curr_idx<$#Resource;$curr_idx++) { |
for ($curr_idx=0;$curr_idx<$#Resource;$curr_idx++) { |
my $curr_item = $Resource[$curr_idx]; |
my $curr_item = $Resource[$curr_idx]; |
&Apache::lonnet::logthis('-----------------------------------'); |
|
while(my($k,$v) = each(%$curr_item)) { |
|
&Apache::lonnet::logthis($k.' = '.$v); |
|
} |
|
last if ($curr_item->{'symb'} eq $target->{'symb'} && |
last if ($curr_item->{'symb'} eq $target->{'symb'} && |
$curr_item->{'part'} eq $target->{'part'} && |
$curr_item->{'part'} eq $target->{'part'} && |
$curr_item->{'respid'} eq $target->{'respid'} && |
$curr_item->{'respid'} eq $target->{'respid'} && |
Line 1634 sub get_prev_curr_next {
|
Line 1623 sub get_prev_curr_next {
|
$curr_item->{'respid'} ne $target->{'respid'} || |
$curr_item->{'respid'} ne $target->{'respid'} || |
$curr_item->{'resptype'} ne $target->{'resptype'}){ |
$curr_item->{'resptype'} ne $target->{'resptype'}){ |
# bogus symb - return nothing |
# bogus symb - return nothing |
&Apache::lonnet::logthis('bailing out'); |
|
return (undef,undef,undef); |
return (undef,undef,undef); |
} |
} |
# |
# |
Line 1667 sub make_target_id {
|
Line 1655 sub make_target_id {
|
|
|
sub get_target_from_id { |
sub get_target_from_id { |
my ($id) = @_; |
my ($id) = @_; |
&Apache::lonnet::logthis('id = '.$id); |
|
my ($symb,$part,$respid,$resptype) = split(':',$id); |
my ($symb,$part,$respid,$resptype) = split(':',$id); |
&Apache::lonnet::logthis('get_target_from_id:symb='.$symb); |
|
&Apache::lonnet::logthis('get_target_from_id:symb='.$part); |
|
&Apache::lonnet::logthis('get_target_from_id:symb='.$respid); |
|
&Apache::lonnet::logthis('get_target_from_id:symb='.$resptype); |
|
return ({ symb =>&Apache::lonnet::unescape($symb), |
return ({ symb =>&Apache::lonnet::unescape($symb), |
part =>&Apache::lonnet::unescape($part), |
part =>&Apache::lonnet::unescape($part), |
respid =>&Apache::lonnet::unescape($respid), |
respid =>&Apache::lonnet::unescape($respid), |