--- loncom/homework/edit.pm 2003/06/16 15:09:23 1.56
+++ loncom/homework/edit.pm 2003/10/06 20:11:38 1.57.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.56 2003/06/16 15:09:23 www Exp $
+# $Id: edit.pm,v 1.57.2.2 2003/10/06 20:11:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -518,7 +518,7 @@ sub text_arg {
my $arg=$token->[2]{$name};
$result=$description.' ';
- return $result;
+ return ''.$result.'';
}
sub select_arg {
@@ -527,23 +527,25 @@ sub select_arg {
my $optionlist="";
my $selected=$token->[2]{$name};
foreach my $option (@$list) {
- my $value;
+ my ($text,$value);
if ( ref($option) eq 'ARRAY') {
$value='value="'.$$option[0].'"';
- $option=$$option[1];
+ $text=$$option[1];
+ $option=$$option[0];
} else {
+ $text=$option;
$value='value="'.$option.'"';
}
if ( $selected eq $option ) {
- $optionlist.="\n";
+ $optionlist.="\n";
} else {
- $optionlist.="\n";
+ $optionlist.="\n";
}
}
- $result.=$description.' ';
return $result;
}
@@ -554,18 +556,20 @@ sub select_or_text_arg {
my $found=0;
my $selected=$token->[2]{$name};
foreach my $option (@$list) {
- my $value;
+ my ($text,$value);
if ( ref($option) eq 'ARRAY') {
$value='value="'.$$option[0].'"';
- $option=$$option[1];
+ $text=$$option[1];
+ $option=$$option[0];
} else {
+ $text=$option;
$value='value="'.$option.'"';
}
if ( $selected eq $option ) {
- $optionlist.="\n";
+ $optionlist.="\n";
$found=1;
} else {
- $optionlist.="\n";
+ $optionlist.="\n";
}
}
$optionlist.="\n";
@@ -577,7 +581,7 @@ sub select_or_text_arg {
} else {
$result.=&text_arg($description,$name,$token,$size);
}
- return $result;
+ return ''.$result.'';
}
#----------------------------------------------------- image coordinates