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

raeburn raeburn@source.lon-capa.org
Wed, 27 Jan 2010 23:26:09 -0000


raeburn		Wed Jan 27 23:26:09 2010 EDT

  Modified files:              
    /loncom/homework	lonsimpleproblemedit.pm 
  Log:
  - Avoid localizing user-supplied options in optionresponse simple problems.
  
  
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.30 loncom/homework/lonsimpleproblemedit.pm:1.31
--- loncom/homework/lonsimpleproblemedit.pm:1.30	Wed Dec  2 18:33:20 2009
+++ loncom/homework/lonsimpleproblemedit.pm	Wed Jan 27 23:26:09 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Problem Parameter Setting "Editor"
 #
-# $Id: lonsimpleproblemedit.pm,v 1.30 2009/12/02 18:33:20 bisitz Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.31 2010/01/27 23:26:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -110,13 +110,19 @@
 
 sub foil {
     my $number=shift;
-    my %values='';
+    my (%values,%defaultvalues,%customvalues);
+    %defaultvalues = &Apache::lonlocal::texthash(
+                         'unused' => 'Not shown, not used'
+                     );
     if ($qtype eq 'radio') {
-	%values=('true' => 'True', 'false' => 'False');
+        %customvalues = &Apache::lonlocal::texthash(
+                                       'true' => 'True',
+                                       'false' => 'False'
+        );
     } elsif ($qtype eq 'option') {
-	%values=&evaloptionhash($qparms{$prefix.'options'});
+        %customvalues=&evaloptionhash($qparms{$prefix.'options'});
     }
-    $values{'unused'}='Not shown, not used';
+    %values = (%defaultvalues,%customvalues);
     my $value=$qparms{$prefix.'value'.$number};
     unless (defined($value)) { $value='unused'; }
     unless ($values{$value}) { $value='unused'; }
@@ -131,7 +137,7 @@
     my $selectvalue=&Apache::loncommon::select_form(
                         $value,
                         'value'.$number,
-                        &Apache::lonlocal::texthash(%values));
+                        %values);
     my $selectposition=&Apache::loncommon::select_form(
                            $position,
                            'position'.$number,