--- loncom/interface/lonmanagekeys.pm 2003/04/23 20:29:17 1.5 +++ loncom/interface/lonmanagekeys.pm 2003/05/02 13:00:19 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to manage course access keys # -# $Id: lonmanagekeys.pm,v 1.5 2003/04/23 20:29:17 www Exp $ +# $Id: lonmanagekeys.pm,v 1.8 2003/05/02 13:00:19 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,7 +54,35 @@ ENDHEAD # =================================================== Show student list to drop sub show_key_list { - my ($r,$mode,$linkto,$action,$statusmode,$classlist,$keylist)=@_; + my ($r,$comment,$newonly,$checkonly,%cenv)=@_; + $comment=~s/\W/\./g; + my %accesskeys=&Apache::lonnet::dump + ('accesskeys',$cenv{'domain'},$cenv{'num'}); + $r->print(''); + foreach (keys %accesskeys) { + if ($_=~/^error\:/) { + $r->print(''); + } elsif ($accesskeys{$_}=~/$comment/) { + my ($checkout,$com)=split(/\s*\#\s*/,$accesskeys{$_}); + unless ($checkout) { + if ($checkonly) { next; } + } else { + if ($newonly) { next; } + } + $r->print("\n'); + } + } + $r->print('
KeyChecked OutComments/Remarks/NotesEnter Additional Comments/Remarks/Notes
No keys have been generated yet.
".$_.''.($checkout? + $checkout:'-').''. + join('
',split(/\s*\;\s*/,$com)). + '
'); + $r->print(''); + return ''; +# +# Junk below +# + my ($mode,$linkto,$action,$statusmode,$classlist,$keylist); # # Just junk so that this compiles # @@ -201,7 +229,8 @@ sub handler { $r->print($msg.'
'); } if ($ENV{'form.listkeys'}) { - &show_key_list($ENV{'form.listcom'},%cenv); + &show_key_list($r,$ENV{'form.listcom'}, + $ENV{'form.newonly'},$ENV{'form.checkonly'},%cenv); } # --- Menu $r->print('

Key Access

'); @@ -216,8 +245,10 @@ Number of keys to be generated:

List Keys

-Comments/Remarks/Notes/Batch Number: +Comments/Remarks/Notes/User/Batch Number:
+ Unused keys only
+ Used keys only
ENDKEYMENU $r->print('');