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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 17 May 2002 21:27:44 -0000


albertel		Fri May 17 17:27:44 2002 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  - (description applies to last commit too)
  - Implements the support for images labels in a randomlabel  image BUG#67
     - displays
     - edits
  
    -doesn't work
      - needs <allow>s generated
      - needs to let students see the images
      - printing
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.26 loncom/homework/randomlabel.pm:1.27
--- loncom/homework/randomlabel.pm:1.26	Fri May 17 17:16:55 2002
+++ loncom/homework/randomlabel.pm	Fri May 17 17:27:44 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # random labelling tool
 #
-# $Id: randomlabel.pm,v 1.26 2002/05/17 21:16:55 albertel Exp $
+# $Id: randomlabel.pm,v 1.27 2002/05/17 21:27:44 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -339,9 +339,11 @@
     push(@Apache::randomlabel::label_arr,$ltext);
   } elsif ($target eq 'edit') {
     $result.=&Apache::edit::tag_start($target,$token,"$type Label");
-    $result.=&Apache::edit::text_arg('Description:','description',$token);
     my $text=&Apache::lonxml::get_all_text("/label",$$parser[-1]);
-    $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
+    if ($type eq 'image') {
+      $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
+      $result.=&Apache::edit::text_arg('Description:','description',$token);
+    }
     if ($type eq 'text') { $result.="Label Text:"; }
     if ($type eq 'image') { $result.="Path to image:"; }
     $result.=&Apache::edit::editline('',$text,'',20).