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

www lon-capa-cvs@mail.lon-capa.org
Wed, 05 Nov 2003 21:43:11 -0000


www		Wed Nov  5 16:43:11 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  Introduce part display, i.e.,
  <part id="13" display="Velocity of the Object">
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.223 loncom/homework/structuretags.pm:1.224
--- loncom/homework/structuretags.pm:1.223	Tue Nov  4 15:09:18 2003
+++ loncom/homework/structuretags.pm	Wed Nov  5 16:43:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.223 2003/11/04 20:09:18 sakharuk Exp $
+# $Id: structuretags.pm,v 1.224 2003/11/05 21:43:11 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -948,7 +948,9 @@
     &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 @@
 	$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").
+	    '&nbsp;&nbsp;'.
+&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();
 	}