--- loncom/homework/edit.pm 2008/11/18 19:14:28 1.118
+++ loncom/homework/edit.pm 2009/10/16 17:23:51 1.124
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.118 2008/11/18 19:14:28 jms Exp $
+# $Id: edit.pm,v 1.124 2009/10/16 17:23:51 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -202,7 +202,7 @@ sub start_table {
$Apache::edit::colordepth++;
push(@Apache::edit::inserttag,$token->[1]);
my $result='
';
- $result.='
';
+ $result.='';
return $result;
}
@@ -230,7 +230,7 @@ sub end_table {
return $result;
}
-sub start_spanning_row { return '';}
+sub start_spanning_row { return ' |
';}
sub start_row { return ' |
'; }
sub end_row { return ' |
'; }
@@ -612,6 +612,18 @@ sub insert_numericalhint {
';
}
+sub insert_reactionhint {
+ return '
+
+';
+}
+
+sub insert_organichint {
+ return '
+
+';
+}
+
sub insert_stringhint {
return '
@@ -842,15 +854,15 @@ sub checked_arg {
$text=$option;
$value='value="'.$option.'"';
}
- $result.="\n";
+ $result.=&element_change_detection().' />'.$text.''."\n";
}
return $result;
}
@@ -863,7 +875,7 @@ sub text_arg {
$result=&mt($description).' ';
- return ''.$result.'';
+ return ''.$result.'';
}
sub select_arg {
@@ -871,26 +883,28 @@ 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).' ';
+ ';
return $result;
}
@@ -900,22 +914,24 @@ sub select_or_text_arg {
my $optionlist="";
my $found=0;
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";
- $found=1;
- } 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";
+ $found=1;
+ } else {
+ $optionlist.="\n";
+ }
+ }
}
$optionlist.="