--- loncom/homework/response.pm 2005/12/06 09:29:34 1.132
+++ loncom/homework/response.pm 2006/01/21 08:17:51 1.135
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.132 2005/12/06 09:29:34 albertel Exp $
+# $Id: response.pm,v 1.135 2006/01/21 08:17:51 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -596,10 +596,18 @@ sub setup_params {
my @answer_bits;
sub answer_header {
- my ($type) = @_;
+ my ($type,$increment) = @_;
my $result;
if ($env{'form.answer_output_mode'} eq 'tex') {
undef(@answer_bits);
+ my $bit;
+ if ($Apache::lonhomework::type eq 'exam') {
+ $bit = ($Apache::lonxml::counter+$increment).') ';
+ } else {
+ $bit .= ' Answer for Part: \verb|'.
+ $Apache::inputtags::part.'| ';
+ }
+ push(@answer_bits,$bit);
} else {
$result = '
';
if ($Apache::lonhomework::type eq 'exam') {
@@ -637,17 +645,9 @@ sub answer_footer {
my ($type) = @_;
my $result;
if ($env{'form.answer_output_mode'} eq 'tex') {
- my $columns = scalar(@answer_bits)+1;
- $result = ' \vskip 0 mm \begin{tabular}{|'.'c|'x$columns.'}\hline ';
- if ($Apache::lonhomework::type eq 'exam') {
- $result .= $Apache::lonxml::counter.') ';
- } else {
- $result .= ' Answer for Part: \verb|'.
- $Apache::inputtags::part.'| ';
- }
- foreach my $bit (@answer_bits) {
- $result.=' & '.$bit;
- }
+ my $columns = scalar(@answer_bits);
+ $result = ' \vskip 0 mm \noindent \begin{tabular}{|'.'c|'x$columns.'}\hline ';
+ $result .= join(' & ',@answer_bits);
$result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm ';
} else {
$result = '
';
@@ -884,7 +884,8 @@ sub add_to_gradingqueue {
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
if ( $courseid eq ''
|| $symb eq ''
- || $env{'request.state'} eq 'construct') {
+ || $env{'request.state'} eq 'construct'
+ || $Apache::lonhomework::type ne 'problem') {
return;
}