version 1.132, 2005/12/06 09:29:34
|
version 1.138, 2006/03/08 22:21:01
|
Line 37 BEGIN {
|
Line 37 BEGIN {
|
|
|
sub start_response { |
sub start_response { |
my ($parstack,$safeeval)=@_; |
my ($parstack,$safeeval)=@_; |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id = &Apache::lonxml::get_id($parstack,$safeeval); |
if ($id eq '') { $id = $Apache::lonxml::curdepth; } |
|
if ($#Apache::inputtags::import > -1) { |
if ($#Apache::inputtags::import > -1) { |
&Apache::lonxml::debug("Turning :$id: into"); |
&Apache::lonxml::debug("Turning :$id: into"); |
$id = join('_',@Apache::inputtags::import).'_'.$id; |
$id = join('_',@Apache::inputtags::import).'_'.$id; |
Line 69 sub end_response {
|
Line 68 sub end_response {
|
|
|
sub start_hintresponse { |
sub start_hintresponse { |
my ($parstack,$safeeval)=@_; |
my ($parstack,$safeeval)=@_; |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id = &Apache::lonxml::get_id($parstack,$safeeval); |
if ($id eq '') { $id = $Apache::lonxml::curdepth; } |
|
push (@Apache::inputtags::hint,$id); |
push (@Apache::inputtags::hint,$id); |
push (@Apache::inputtags::hintlist,$id); |
push (@Apache::inputtags::hintlist,$id); |
push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); |
push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); |
Line 596 sub setup_params {
|
Line 594 sub setup_params {
|
my @answer_bits; |
my @answer_bits; |
|
|
sub answer_header { |
sub answer_header { |
my ($type) = @_; |
my ($type,$increment) = @_; |
my $result; |
my $result; |
if ($env{'form.answer_output_mode'} eq 'tex') { |
if ($env{'form.answer_output_mode'} eq 'tex') { |
undef(@answer_bits); |
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 { |
} else { |
$result = '<table border="1"><tr>'; |
$result = '<table border="1"><tr>'; |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
$result .= '<td>'.$Apache::lonxml::counter. ')</td>'; |
$result .= '<td>'.($Apache::lonxml::counter+$increment). ')</td>'; |
} else { |
} else { |
$result .= '<td>Answer for Part:'.$Apache::inputtags::part.'</td>'; |
$result .= '<td>Answer for Part:'.$Apache::inputtags::part.'</td>'; |
} |
} |
Line 637 sub answer_footer {
|
Line 643 sub answer_footer {
|
my ($type) = @_; |
my ($type) = @_; |
my $result; |
my $result; |
if ($env{'form.answer_output_mode'} eq 'tex') { |
if ($env{'form.answer_output_mode'} eq 'tex') { |
my $columns = scalar(@answer_bits)+1; |
my $columns = scalar(@answer_bits); |
$result = ' \vskip 0 mm \begin{tabular}{|'.'c|'x$columns.'}\hline '; |
$result = ' \vskip 0 mm \noindent \begin{tabular}{|'.'c|'x$columns.'}\hline '; |
if ($Apache::lonhomework::type eq 'exam') { |
$result .= join(' & ',@answer_bits); |
$result .= $Apache::lonxml::counter.') '; |
|
} else { |
|
$result .= ' Answer for Part: \verb|'. |
|
$Apache::inputtags::part.'| '; |
|
} |
|
foreach my $bit (@answer_bits) { |
|
$result.=' & '.$bit; |
|
} |
|
$result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm '; |
$result .= ' \\\\ \\hline \end{tabular} \vskip 0 mm '; |
} else { |
} else { |
$result = '</tr></table>'; |
$result = '</tr></table>'; |
Line 884 sub add_to_gradingqueue {
|
Line 882 sub add_to_gradingqueue {
|
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
if ( $courseid eq '' |
if ( $courseid eq '' |
|| $symb eq '' |
|| $symb eq '' |
|| $env{'request.state'} eq 'construct') { |
|| $env{'request.state'} eq 'construct' |
|
|| $Apache::lonhomework::type ne 'problem') { |
return; |
return; |
} |
} |
|
|