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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 17 Jul 2002 18:06:18 -0000


albertel		Wed Jul 17 14:06:18 2002 EDT

  Modified files:              
    /loncom/homework	edit.pm radiobuttonresponse.pm 
  Log:
  - supports variables in the possible args to a foil for a rbr type question BUG#584
  
  
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.34 loncom/homework/edit.pm:1.35
--- loncom/homework/edit.pm:1.34	Fri Apr 26 09:30:08 2002
+++ loncom/homework/edit.pm	Wed Jul 17 14:06:18 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # edit mode helpers
 #
-# $Id: edit.pm,v 1.34 2002/04/26 13:30:08 harris41 Exp $
+# $Id: edit.pm,v 1.35 2002/07/17 18:06:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -426,7 +426,7 @@
     }
   }
   $optionlist.="<option value=\"TYPEDINVALUE\">Type in value</option>\n";
-  if ($found) {
+  if (($found) || (!$selected)) {
     $result.=$description.'<select name="'."$Apache::lonxml::curdepth.$name".'">
        '.$optionlist.'
       </select>';
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.41 loncom/homework/radiobuttonresponse.pm:1.42
--- loncom/homework/radiobuttonresponse.pm:1.41	Fri May  3 16:13:14 2002
+++ loncom/homework/radiobuttonresponse.pm	Wed Jul 17 14:06:18 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.41 2002/05/03 20:13:14 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.42 2002/07/17 18:06:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -29,6 +29,7 @@
 
 package Apache::radiobuttonresponse;
 use strict;
+use HTML::Entities();
 
 BEGIN {
   &Apache::lonxml::register('Apache::radiobuttonresponse',('radiobuttonresponse'));
@@ -217,7 +218,7 @@
 	push (@falselist,$name);
       } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') {
       } else {
-	&Apache::lonxml::error(&HTML::Entites::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>"));
+	&Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>"));
       }
     }
     my $whichtrue = int(rand($#truelist+1));
@@ -341,7 +342,7 @@
   } elsif ($target eq 'edit') {
     $result=&Apache::edit::tag_start($target,$token);
     $result.=&Apache::edit::text_arg('Name:','name',$token);
-    $result.=&Apache::edit::select_arg('Correct Option:','value',
+    $result.=&Apache::edit::select_or_text_arg('Correct Option:','value',
 				       ['unused','true','false'],$token);
     $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
   } elsif ($target eq 'modified') {