Answer for Part:'.
+ $Apache::inputtags::part. ' | '."\n";
+ }
}
- }
- return $result;
+ return $result;
}
-sub end_responseparam {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'edit') { return ('','no'); }
- return '';
+sub answer_part {
+ my ($type,$answer) = @_;
+ my $result;
+ if (($ENV{'form.print_answer'} eq 'yes') && ($ENV{'form.grade_target'} eq 'answer')) {
+ $result = ' '.$answer.'\\\\ \hline ';
+ } else {
+ if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
+ $result = ''.$answer.' | ';
+ } else {
+ $result = ''.$answer.' | ';
+ }
+ }
+ return $result;
}
-sub setup_params {
- my ($tag) = @_;
-
- @Apache::inputtags::params=();
- my %paramlist=();
- foreach my $key (keys(%Apache::lonnet::packagetab)) {
- if ($key =~ /^$tag/) {
- my ($package,$name) = split(/&/,$key);
- $paramlist{$name}=1;
- }
- }
- foreach my $key (keys(%paramlist)) {
- my $entry= 'resource.'.$Apache::inputtags::part;
- if (defined($Apache::inputtags::response[-1])) {
- $entry.='_'.$Apache::inputtags::response[-1];
- }
- $entry.='.'.$key;
- &Apache::lonxml::debug("looking for $entry");
- my $value = &Apache::lonnet::EXT("$entry");
- &Apache::lonxml::debug("$key has value :$value:");
- if ($value eq 'con_lost' || $value =~ /^error:/) {
- &Apache::lonxml::debug("using nothing");
- $Apache::inputtags::params{$key}='';
+sub answer_footer {
+ my ($type) = @_;
+ my $result;
+ if (($ENV{'form.print_answer'} eq 'yes') && ($ENV{'form.grade_target'} eq 'answer')) {
+ $result = ' \end{tabular} \vskip 0 mm ';
} else {
- &Apache::lonxml::debug("using value");
- $Apache::inputtags::params{$key}=$value;
+ if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
+ $result = '