--- loncom/homework/edit.pm 2005/04/07 06:56:21 1.92
+++ loncom/homework/edit.pm 2005/11/10 22:19:27 1.95
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.92 2005/04/07 06:56:21 albertel Exp $
+# $Id: edit.pm,v 1.95 2005/11/10 22:19:27 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -92,10 +92,12 @@ sub start_table {
foreach my $namespace (reverse @Apache::lonxml::namespace) {
my $testtag=$namespace.'::'.$tag;
$tagnum=$Apache::lonxml::insertlist{"$testtag.num"};
+ &Apache::lonxml::debug(" $testtag ");
if (defined($tagnum)) { last; }
}
if (!defined ($tagnum)) {$tagnum=$Apache::lonxml::insertlist{"$tag.num"};}
my $color = $Apache::lonxml::insertlist{"$tagnum.color"};
+ &Apache::lonxml::debug(" $tagnum -- $color");
if (!defined($color)) {
$color = $Apache::edit::colorlist[$Apache::edit::colordepth];
}
@@ -109,7 +111,7 @@ sub start_table {
sub end_table {
$Apache::edit::colordepth--;
my $result='';
- $result.="
";
+ $result.='';
my ($tagname,$closingtag);
if (defined($Apache::edit::inserttag[-2])) {
@@ -119,7 +121,7 @@ sub end_table {
$closingtag=$Apache::edit::inserttag[-1];
}
$result.=&innerinsertlist('edit',$tagname,$closingtag).
- " |
";
+ " |
";
pop(@Apache::edit::inserttag);
return $result;
}
@@ -309,6 +311,25 @@ sub insert_numericalresponse {
';
}
+sub insert_algorithmicresponse {
+ return '
+
+
+
+
+
+
+
+';
+}
+
+sub insert_algorithmicresponse_answer {
+ return '
+
+
+';
+}
+
sub insert_stringresponse {
return '
@@ -654,12 +675,12 @@ sub select_arg {
foreach my $option (@$list) {
my ($text,$value);
if ( ref($option) eq 'ARRAY') {
- $value='value="'.$$option[0].'"';
+ $value='value="'.&HTML::Entities::encode($$option[0]).'"';
$text=$$option[1];
$option=$$option[0];
} else {
$text=$option;
- $value='value="'.$option.'"';
+ $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
}
if ( $selected eq $option ) {
$optionlist.="\n";
@@ -683,12 +704,12 @@ sub select_or_text_arg {
foreach my $option (@$list) {
my ($text,$value);
if ( ref($option) eq 'ARRAY') {
- $value='value="'.$$option[0].'"';
+ $value='value="'.&HTML::Entities::encode($$option[0]).'"';
$text=$$option[1];
$option=$$option[0];
} else {
$text=$option;
- $value='value="'.$option.'"';
+ $value='value="'.&HTML::Entities::encode($option,'\'"&<>').'"';
}
if ( $selected eq $option ) {
$optionlist.="\n";