File:  [LON-CAPA] / loncom / homework / hint.pm
Revision 1.1: download - view: text, annotated - select for diffs
Tue Dec 19 23:22:22 2000 UTC (23 years, 4 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- adding the needed lectuure online tags
  not funtional currently but getting close

package Apache::hinttags; 

use strict;
use Apache::lonnet;

sub BEGIN {
  &Apache::lonxml::register('Apache::hinttags',('hintgroup','hintpart'));
}

#currently hintgroup has no purpose
sub start_hintgroup {
}

sub end_hintgroup {
}

sub start_hintpart {
  my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;

  my $show ='0';
  if ($target ne 'meta' && $target ne 'grade') {
    my $args ='';
    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;
      foreach $key (keys %results) {
	&Apache::lonxml::debug("Got $key");
      }
    }
    if (!$show) {
      &Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]);
    }
  } else {
    &Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]);
  }
  return '';
}

sub end_hintpart {
}

1;
__END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>