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

raeburn raeburn at source.lon-capa.org
Tue Dec 18 11:30:23 EST 2012


raeburn		Tue Dec 18 16:30:23 2012 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm 
  Log:
  - Sanity checking.
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.188 loncom/homework/optionresponse.pm:1.189
--- loncom/homework/optionresponse.pm:1.188	Fri Nov 30 11:45:50 2012
+++ loncom/homework/optionresponse.pm	Tue Dec 18 16:30:23 2012
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.188 2012/11/30 11:45:50 foxr Exp $
+# $Id: optionresponse.pm,v 1.189 2012/12/18 16:30:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -499,8 +499,11 @@
 sub displayfoils {
   my ($target,$max,$randomize,$TeXlayout,$checkboxvalue,$checkboxchoices,
       $tex_option_switch, $no_tfprompt, @opt)=@_;
-  if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;}
-  my @names = @{ $Apache::response::foilgroup{'names'} };
+  my @names; 
+  if (ref($Apache::response::foilgroup{'names'}) eq 'ARRAY') {
+      @names = @{ $Apache::response::foilgroup{'names'} };
+  }
+  unless (@names > 0) { return;}
   my @truelist;
   my @falselist;
   my $result;  




More information about the LON-CAPA-cvs mailing list