version 1.130, 2005/11/21 22:45:13
|
version 1.134, 2005/12/20 16:31:50
|
Line 592 sub setup_params {
|
Line 592 sub setup_params {
|
} |
} |
} |
} |
|
|
|
{ |
|
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') { |
$result = ' \vskip 0 mm \begin{tabular}{|c|}\hline Answer for Part: \verb|'. |
undef(@answer_bits); |
$Apache::inputtags::part.'| \\\\ \hline '; |
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><td>Answer for Part:'. |
$result = '<table border="1"><tr>'; |
$Apache::inputtags::part. '</td>'."\n"; |
if ($Apache::lonhomework::type eq 'exam') { |
|
$result .= '<td>'.$Apache::lonxml::counter. ')</td>'; |
|
} else { |
|
$result .= '<td>Answer for Part:'.$Apache::inputtags::part.'</td>'; |
|
} |
|
$result .= "\n"; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 617 sub answer_part {
|
Line 632 sub answer_part {
|
last; |
last; |
} |
} |
} |
} |
$result = '\verb'.$to_use.$answer.$to_use.'\\\\ \hline '; |
if ($answer ne '') { |
|
push(@answer_bits,'\verb'.$to_use.$answer.$to_use); |
|
} |
} else { |
} else { |
$result = '<td>'.$answer.'</td>'; |
$result = '<td>'.$answer.'</td>'; |
} |
} |
Line 628 sub answer_footer {
|
Line 645 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') { |
$result = ' \end{tabular} \vskip 0 mm '; |
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 { |
} else { |
$result = '</tr></table>'; |
$result = '</tr></table>'; |
} |
} |
return $result; |
return $result; |
} |
} |
|
|
|
} |
|
|
sub showallfoils { |
sub showallfoils { |
if (defined($env{'form.showallfoils'})) { |
if (defined($env{'form.showallfoils'})) { |
my ($symb)=&Apache::lonxml::whichuser(); |
my ($symb)=&Apache::lonxml::whichuser(); |
Line 859 sub submitted {
|
Line 881 sub submitted {
|
} |
} |
|
|
sub add_to_gradingqueue { |
sub add_to_gradingqueue { |
my ($nothing) = @_; |
my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); |
|
if ( $courseid eq '' |
|
|| $symb eq '' |
|
|| $env{'request.state'} eq 'construct') { |
|
return; |
|
} |
|
|
my %queue_info = ( 'type' => 'problem', |
my %queue_info = ( 'type' => 'problem', |
'time' => time); |
'time' => time); |