--- loncom/homework/optionresponse.pm 2001/06/16 18:35:27 1.15
+++ loncom/homework/optionresponse.pm 2001/06/16 20:33:33 1.16
@@ -20,7 +20,7 @@ sub start_optionresponse {
$result.=&Apache::edit::start_table($token)."
Multiple Option Response Question |
Delete:".
&Apache::edit::deletelist($target,$token)
-." |
\n";
+." | |
\n";
}
return $result;
@@ -59,6 +59,7 @@ sub start_foilgroup {
my $count=0;
foreach $option (@opt) {
$optionlist.="\n";
+ $count++;
}
my $insertlist=&Apache::edit::insertlist($target,$token);
$result.=&Apache::edit::start_table($token);
@@ -80,6 +81,7 @@ ENDTABLE
eval '@options ='.&Apache::lonxml::get_param('options',$parstack,$safeeval);
if ($ENV{"form.$Apache::lonxml::curdepth.deleteopt"}) {
my $delopt=$ENV{"form.$Apache::lonxml::curdepth.deleteopt"};
+ &Apache::lonxml::debug("Deleting :$delopt:");
splice(@options,$delopt,1);
$optchanged=1;
}
@@ -222,6 +224,10 @@ sub start_conceptgroup {
my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval);
$result.="Concept: |
";
}
+ if ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'concept');
+ if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
+ }
return $result;
}
@@ -246,6 +252,11 @@ sub end_conceptgroup {
return $result;
}
+sub insert_conceptgroup {
+ my $result="\t\t\n".&insert_foil()."\t\t\n";
+ return $result;
+}
+
sub start_foil {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
@@ -273,24 +284,8 @@ sub start_foil {
|
";
}
if ($target eq 'modified') {
- my $constructtag=0;
- foreach my $arg ('value','name') {
- my $value=&Apache::lonxml::get_param($arg,$parstack,$safeeval);
- my $newvalue=$ENV{"form.$Apache::lonxml::curdepth.$arg"};
- &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
- if ($value ne $newvalue) {
- $token->[2]->{$arg}=$newvalue;
- $constructtag=1;
- }
- }
- if ($constructtag) {
- $result = '<'.$token->[1];
- while (my ($key,$val)= each(%{$token->[2]})) {
- &Apache::lonxml::debug("setting :$key: to :$val:");
- $result.=' '.$key.'="'.$val.'"';
- }
- $result.=">";
- }
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'value','name');
+ if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
}
return $result;
}
|