[LON-CAPA-cvs] cvs: loncom /homework response.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Tue, 13 May 2003 15:27:02 -0000
sakharuk Tue May 13 11:27:02 2003 EDT
Modified files:
/loncom/homework response.pm
Log:
Changes in answer_header, answer_part, and anser_footer to produce LaTeX output for the answer target neccessary to print problems with answers.
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.74 loncom/homework/response.pm:1.75
--- loncom/homework/response.pm:1.74 Wed Apr 30 17:23:45 2003
+++ loncom/homework/response.pm Tue May 13 11:27:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.74 2003/04/30 21:23:45 albertel Exp $
+# $Id: response.pm,v 1.75 2003/05/13 15:27:01 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -363,12 +363,17 @@
sub answer_header {
my ($type) = @_;
my $result;
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse' ) {
- $result = '<table border="1"><tr><th>Answer for Part:'.
- $Apache::inputtags::part. '</th></tr><tr>'."\n";
+ if ($ENV{'form.print_answer'} eq 'yes') {
+ $result = ' \vskip 0 mm \begin{tabular}{|c|}\hline Answer for Part: '.
+ $Apache::inputtags::part.' \\\\ \hline ';
} else {
- $result = '<table border="1"><tr><td>Answer for Part:'.
- $Apache::inputtags::part. '</td>'."\n";
+ if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse' ) {
+ $result = '<table border="1"><tr><th>Answer for Part:'.
+ $Apache::inputtags::part. '</th></tr><tr>'."\n";
+ } else {
+ $result = '<table border="1"><tr><td>Answer for Part:'.
+ $Apache::inputtags::part. '</td>'."\n";
+ }
}
return $result;
}
@@ -376,10 +381,14 @@
sub answer_part {
my ($type,$answer) = @_;
my $result;
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
- $result = '<td>'.$answer.'</td>';
+ if ($ENV{'form.print_answer'} eq 'yes') {
+ $result = ' '.$answer.'\\\\ \hline ';
} else {
- $result = '<td>'.$answer.'</td>';
+ if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
+ $result = '<td>'.$answer.'</td>';
+ } else {
+ $result = '<td>'.$answer.'</td>';
+ }
}
return $result;
}
@@ -387,10 +396,14 @@
sub answer_footer {
my ($type) = @_;
my $result;
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
- $result = '</tr></table>';
+ if ($ENV{'form.print_answer'} eq 'yes') {
+ $result = ' \end{tabular} \vskip 0 mm ';
} else {
- $result = '</tr></table>';
+ if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
+ $result = '</tr></table>';
+ } else {
+ $result = '</tr></table>';
+ }
}
return $result;
}