version 1.93, 2003/04/18 07:12:13
|
version 1.94, 2003/04/21 17:51:46
|
Line 147 sub end_numericalresponse {
|
Line 147 sub end_numericalresponse {
|
$safeeval); |
$safeeval); |
my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"}; |
my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"}; |
my $status = $Apache::inputtags::status['-1']; |
my $status = $Apache::inputtags::status['-1']; |
if ($award =~ /^correct/ || $status eq "SHOW_ANSWER" ) { |
if ($award =~ /^correct/ || $status eq "SHOW_ANSWER" || $ENV{'form.texaward'} eq 'SHOW_ANSWER') { |
my (@formats)=&Apache::lonxml::get_param_var('format',$parstack, |
my (@formats)=&Apache::lonxml::get_param_var('format',$parstack, |
$safeeval); |
$safeeval); |
my $unit=&Apache::lonxml::get_param_var('unit',$parstack, |
my $unit=&Apache::lonxml::get_param_var('unit',$parstack, |
Line 155 sub end_numericalresponse {
|
Line 155 sub end_numericalresponse {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$result="<br />The correct answer is "; |
$result="<br />The correct answer is "; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
#$result='\vskip 0 mm The correct answer is \\texttt{'; |
if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') { |
|
$result='\vskip 0 mm The correct answer is \\texttt{ '; |
|
} |
} |
} |
for (my $i=0; $i <= $#answers; $i++) { |
for (my $i=0; $i <= $#answers; $i++) { |
my $answer=$answers[$i]; |
my $answer=$answers[$i]; |
Line 173 sub end_numericalresponse {
|
Line 175 sub end_numericalresponse {
|
&Apache::lonxml::debug("no format answer :$answer:"); |
&Apache::lonxml::debug("no format answer :$answer:"); |
$formatted="$answer,"; |
$formatted="$answer,"; |
} |
} |
|
if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') { |
|
$result.=$formatted; |
|
} |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$formatted=''; |
$formatted=''; |
#$formatted=&Apache::lonxml::latex_special_symbols($formatted); |
#$formatted=&Apache::lonxml::latex_special_symbols($formatted); |
Line 183 sub end_numericalresponse {
|
Line 187 sub end_numericalresponse {
|
chop $result; |
chop $result; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result.=" $unit.<br />"; |
$result.=" $unit.<br />"; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
#$result.=&Apache::lonxml::latex_special_symbols($unit); |
if ($ENV{'form.texaward'} eq 'SHOW_ANSWER') { |
#$result.="}. \\vskip 0 mm "; |
$result.=&Apache::lonxml::latex_special_symbols($unit); |
|
$result.="}. \\vskip 0 mm "; |
|
} |
} |
} |
} |
} |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |