--- loncom/homework/hint.pm 2003/04/02 18:51:11 1.37 +++ loncom/homework/hint.pm 2003/04/07 23:02:06 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # implements the tags that control the hints # -# $Id: hint.pm,v 1.37 2003/04/02 18:51:11 sakharuk Exp $ +# $Id: hint.pm,v 1.38 2003/04/07 23:02:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,14 +50,14 @@ sub start_hintgroup { my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries"); if ( $hinttries eq '') { $hinttries = 1; } &Apache::lonxml::debug("found :$id:$numtries:$hinttries:"); - if ( $numtries < $hinttries ) { - $skiptoend='1'; - } else { - if ($target eq 'web' && $Apache::lonhomework::type ne 'exam') { - $result='
'; - } elsif ($Apache::lonhomework::type eq 'exam') { - &Apache::lonxml::startredirection; + if ($Apache::lonhomework::type ne 'exam') { + if ( $numtries < $hinttries ) { + $skiptoend='1'; + } else { + $result='
'; } + } else { + &Apache::lonxml::startredirection; } if ($skiptoend) { &Apache::lonxml::get_all_text("/hintgroup",$parser); @@ -80,10 +80,12 @@ sub end_hintgroup { my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries"); if ( $hinttries eq '') { $hinttries = 1; } &Apache::lonxml::debug("found :$id:$numtries:$hinttries:"); - if ( $numtries >= $hinttries && $Apache::lonhomework::type ne 'exam') { - $result='
'; - } elsif ($Apache::lonhomework::type eq 'exam') { - my $garbage = &Apache::lonxml::endredirection; + if ($Apache::lonhomework::type ne 'exam') { + if ( $numtries >= $hinttries ) { + $result='
'; + } + } else { + &Apache::lonxml::endredirection; } } elsif ($target eq 'edit') { $result.=&Apache::edit::end_table();