--- loncom/homework/structuretags.pm 2003/11/04 14:46:28 1.222 +++ loncom/homework/structuretags.pm 2003/11/05 21:43:11 1.224 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.222 2003/11/04 14:46:28 sakharuk Exp $ +# $Id: structuretags.pm,v 1.224 2003/11/05 21:43:11 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -457,12 +457,12 @@ sub start_problem { } my $id = $Apache::inputtags::part; my $weight = &Apache::lonnet::EXT("resource.$id.weight"); - my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'keys'); - my @allkeys = split /,/,$allkeys; - my $allow_print_points = 1; - foreach my $partial_key (@allkeys) { - if ($partial_key=~m/\_(\d*)\_weight/) { - if ($1 ne '0') {$allow_print_points=0;} + my $packages=&Apache::lonnet::metadata($ENV{'request.uri'},'packages'); + my @packages = split /,/,$packages; + my $allow_print_points = 0; + foreach my $partial_key (@packages) { + if ($partial_key=~m/part_0/) { + $allow_print_points=1; } } my $duedate = &Apache::lonnet::EXT("resource.$id.duedate"); @@ -948,7 +948,9 @@ sub start_part { &Apache::run::run($expression,$safeeval); if ($target eq 'meta') { - return &Apache::response::mandatory_part_meta; + my $display=&Apache::lonxml::get_param('display',$parstack,$safeeval); + return &Apache::response::mandatory_part_meta. + &Apache::response::meta_parameter_write('display','string',$display,'Part Description'); } elsif ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { if ($hidden) { @@ -996,11 +998,16 @@ sub start_part { $result.=&Apache::edit::tag_start($target,$token); $result.=&Apache::edit::text_arg('Part ID:','id',$token). &Apache::loncommon::help_open_topic("Part_Tag_Edit_Help"). + '  '. +&Apache::edit::text_arg('Displayed Part Description:','display',$token). &Apache::edit::end_row().&Apache::edit::start_spanning_row(); } elsif ($target eq 'modified') { my $constructtag=&Apache::edit::get_new_args($token,$parstack, - $safeeval,'id'); + $safeeval,'id'). + &Apache::edit::get_new_args($token,$parstack, + $safeeval,'display'); if ($constructtag) { + $token->[2]->{'id'}=~s/[^A-Za-z0-9 ]//gs; $result = &Apache::edit::rebuild_tag($token); $result.=&Apache::edit::handle_insert(); }