--- loncom/homework/edit.pm 2001/06/27 18:51:12 1.15
+++ loncom/homework/edit.pm 2001/08/13 21:43:48 1.21
@@ -146,12 +146,10 @@ $optionlist
}
sub handle_insert {
- &Apache::lonxml::debug("Er handle insert called");
if ($ENV{"form.insert_$Apache::lonxml::curdepth"} eq '') { return ''; }
my $result;
my $tagnum = $ENV{"form.insert_$Apache::lonxml::curdepth"};
my $func=$Apache::lonxml::insertlist{"$tagnum.function"};
- &Apache::lonxml::debug("Looking for :$func:");
if ($func eq 'default') {
my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
my $namespace;
@@ -171,6 +169,11 @@ sub handle_insert {
return $result;
}
+sub insert_responseparam {
+ return '
+ ';
+}
+
sub insert_numericalresponse {
return '
@@ -180,6 +183,15 @@ sub insert_numericalresponse {
';
}
+sub insert_stringresponse {
+ return '
+
+
+
+
+';
+}
+
sub insert_optionresponse {
return '
@@ -190,6 +202,9 @@ sub insert_optionresponse {
';
}
+sub insert_displayduedate { return ''; }
+sub insert_displaytitle { return ''; }
+
sub editfield {
my ($tag,$data,$description,$minwidth,$minheight)=@_;
@@ -241,7 +256,8 @@ sub get_new_args {
my ($token,$parstack,$safeeval,@args)=@_;
my $rebuild=0;
foreach my $arg (@args) {
- my $value=&Apache::lonxml::get_param($arg,$parstack,$safeeval);
+ #just want the string that it was set to
+ my $value=$token->[2]->{$arg};
my $newvalue=$ENV{"form.$Apache::lonxml::curdepth.$arg"};
&Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
if ($value ne $newvalue) {
@@ -259,6 +275,8 @@ sub rebuild_tag {
if ($token->[0] eq 'S') {
$result = '<'.$token->[1];
while (my ($key,$val)= each(%{$token->[2]})) {
+ $val=~s:^\s+|\s+$::g;
+ $val=~s:"::g; #"
&Apache::lonxml::debug("setting :$key: to :$val:");
$result.=' '.$key.'="'.$val.'"';
}
@@ -301,5 +319,29 @@ sub select_arg {
return $result;
}
+sub select_or_text_arg {
+ my ($description,$name,$list,$token,$size) = @_;
+ my $result;
+ my $optionlist="";
+ my $found=0;
+ my $selected=$token->[2]{$name};
+ foreach my $option (@$list) {
+ if ( $selected eq $option ) {
+ $optionlist.="\n";
+ $found=1;
+ } else {
+ $optionlist.="\n";
+ }
+ }
+ $optionlist.="\n";
+ if ($found) {
+ $result.=$description.'
';
+ } else {
+ $result.=&text_arg($description,$name,$token,$size);
+ }
+ return $result;
+}
1;
__END__
|