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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 22 Apr 2005 14:03:56 -0000


albertel		Fri Apr 22 10:03:56 2005 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  - adding name fields to foil edit screen
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.66 loncom/homework/imageresponse.pm:1.67
--- loncom/homework/imageresponse.pm:1.66	Tue Apr 19 05:20:55 2005
+++ loncom/homework/imageresponse.pm	Fri Apr 22 10:03:56 2005
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.66 2005/04/19 09:20:55 foxr Exp $
+# $Id: imageresponse.pm,v 1.67 2005/04/22 14:03:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -343,6 +343,7 @@
 $Apache::imageresponse::curname='';
 sub start_foil {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+    my $result;
     if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
 	$target eq 'analyze') {
 	my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
@@ -362,8 +363,17 @@
 	    push(@{ $Apache::response::foilgroup{'names'} }, $name);
 	}
 	$Apache::imageresponse::curname=$name;
-    }
-    return '';
+    } elsif ($target eq 'edit') {
+	$result  = &Apache::edit::tag_start($target,$token);
+	$result .= &Apache::edit::text_arg('Name:','name',$token);
+	$result .= &Apache::edit::end_row().
+	    &Apache::edit::start_spanning_row();
+    } elsif ($target eq 'modified') {
+	my $constructtag=&Apache::edit::get_new_args($token,$parstack,
+						     $safeeval,'name');
+	if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
+    } 
+    return $result;;
 }
 
 sub end_foil {