--- loncom/homework/hint.pm 2000/12/19 23:22:22 1.1 +++ loncom/homework/hint.pm 2000/12/21 18:13:33 1.2 @@ -7,14 +7,27 @@ sub BEGIN { &Apache::lonxml::register('Apache::hinttags',('hintgroup','hintpart')); } -#currently hintgroup has no purpose + sub start_hintgroup { + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my $id=$Apache::inputtags::part; + my $numtries=$Apache::lonhomework::history{"resource.$id.tries"}; + if ( $numtries eq '') { $numtries = 0; } + my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries"); + if ( $hinttries eq '') { $hinttries = 1; } + &Apache::lonxml::debug("found :$id:$numtries:$hinttries:"); + if ( $numtries < $hinttries ) { + &Apache::lonxml::get_all_text("/hintgroup",$$parser[$#$parser]); + } + return ''; } sub end_hintgroup { } +# a part shows if it is on, if no specific parts are on, then default shows sub start_hintpart { + return ''; my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; my $show ='0'; @@ -23,7 +36,6 @@ sub start_hintpart { if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } my $on = &Apache::run::run("{$args;".'return $on}',$safeeval); if ( $on eq 'default') { - $show='1'; } else { my (%results) = &Apache::run::run("{$args; return ".'\%'.$on,$safeeval); my $key;