[LON-CAPA-cvs] cvs: loncom /homework grades.pm

Guy Albertelli II lon-capa-cvs@mail.lon-capa.org
Wed, 3 Jul 2002 17:28:14 -0400 (EDT)


Hi hk,

Looks good,
3 comments

1)
sub keywords_highlight {
  my $string  = shift;
  (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
  my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} :
  (&Apache::lonnet::symbread($url)));

Why not pass the symb to this function, get_previous_attempt has it?

2)
sub keywords_highlight {
...
my %keyhash = &Apache::lonnet::get
      ('nohist_handgrade',[$symb.'_keywords'],
       $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
       $ENV{'course.'.$ENV{'request.course.id'}.'.num'});

lonnet::get is a fairly expensive opertaion, why not store the earlier
get in a global that this function can use, rather than getting the
keywords again for table element?

3)
 my ($responsetype,$foo) = split(/_/,&Apache::lonnet::metadata($url,'packages'));

As far as I can tell you never use this information yet, although you
are diligent in passing into the forms, anything you are planning on
using it for?

-- 
guy@albertelli.com          BM: n^20 t20 z20 qS 
Guy Albertelli -7-8-4-  O-
    My parents just came back from a planet where the dominant lifeform
    had no bilateral symmetry, and all I got was this stupid F-Shirt.