--- loncom/homework/edit.pm 2008/12/10 21:45:31 1.120
+++ loncom/homework/edit.pm 2008/12/10 21:59:43 1.121
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.120 2008/12/10 21:45:31 bisitz Exp $
+# $Id: edit.pm,v 1.121 2008/12/10 21:59:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -871,21 +871,23 @@ sub select_arg {
my $result;
my $optionlist="";
my $selected=$token->[2]{$name};
- foreach my $option (@$list) {
- my ($text,$value);
- if ( ref($option) eq 'ARRAY') {
- $value='value="'.&HTML::Entities::encode($$option[0]).'"';
- $text=$$option[1];
- $option=$$option[0];
- } else {
- $text=$option;
- $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
- }
- if ( $selected eq $option ) {
- $optionlist.="\n";
- } else {
- $optionlist.="\n";
- }
+ if (ref($list) eq 'ARRAY') {
+ foreach my $option (@{$list}) {
+ my ($text,$value);
+ if (ref($option) eq 'ARRAY') {
+ $value='value="'.&HTML::Entities::encode($option->[0]).'"';
+ $text=$option->[1];
+ $option=$option->[0];
+ } else {
+ $text=$option;
+ $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
+ }
+ if ( $selected eq $option ) {
+ $optionlist.="\n";
+ } else {
+ $optionlist.="\n";
+ }
+ }
}
$result.=''.&mt($description).'