version 1.178, 2005/11/03 17:44:15
|
version 1.180, 2005/11/15 22:28:30
|
Line 386 sub checkstatus {
|
Line 386 sub checkstatus {
|
return(undef,undef); |
return(undef,undef); |
} |
} |
|
|
|
sub valid_award { |
|
my ($award) =@_; |
|
foreach my $possibleaward ('MISSING_ANSWER', 'ERROR', 'NO_RESPONSE', |
|
'TOO_LONG', 'UNIT_INVALID_INSTRUCTOR', |
|
'UNIT_INVALID_STUDENT', 'UNIT_IRRECONCIBLE', |
|
'UNIT_FAIL', 'NO_UNIT', |
|
'UNIT_NOTNEEDED', 'WANTED_NUMERIC', |
|
'BAD_FORMULA', 'SIG_FAIL', 'INCORRECT', |
|
'MISORDERED_RANK', 'INVALID_FILETYPE', |
|
'DRAFT', 'SUBMITTED', 'ASSIGNED_SCORE', |
|
'APPROX_ANS', 'EXACT_ANS','COMMA_FAIL') { |
|
if ($award eq $possibleaward) { return 1; } |
|
} |
|
return 0; |
|
} |
|
|
sub finalizeawards { |
sub finalizeawards { |
my ($awardref,$msgref)=@_; |
my ($awardref,$msgref)=@_; |
my $result=undef; |
my $result=undef; |
Line 432 sub decideoutput {
|
Line 448 sub decideoutput {
|
'no_message' => '#fffff', |
'no_message' => '#fffff', |
); |
); |
|
|
|
my $part = $Apache::inputtags::part; |
|
my $handgrade = |
|
('yes' eq lc(&Apache::lonnet::EXT("resource.$part.handgrade"))); |
|
|
|
my $computer = ($handgrade)? '' |
|
: " ".&mt("Computer's answer now shown above."); |
|
&Apache::lonxml::debug("handgrade has :$handgrade:"); |
|
|
if ($previous) { $previousmsg=&mt('You have entered that answer before'); } |
if ($previous) { $previousmsg=&mt('You have entered that answer before'); } |
|
|
if ($solved =~ /^correct/) { |
if ($solved =~ /^correct/) { |
Line 453 sub decideoutput {
|
Line 477 sub decideoutput {
|
$message = '\textbf{'.$message.'}'; |
$message = '\textbf{'.$message.'}'; |
} else { |
} else { |
$message = "<b>".$message."</b>"; |
$message = "<b>".$message."</b>"; |
$message.=" ".&mt("Computer's answer now shown above."); |
$message.= $computer; |
} |
} |
$added_computer_text=1; |
$added_computer_text=1; |
unless ($env{'course.'. |
unless ($env{'course.'. |
Line 485 sub decideoutput {
|
Line 509 sub decideoutput {
|
$message = '\textbf{'.&mt('You are correct.').'}'; |
$message = '\textbf{'.&mt('You are correct.').'}'; |
} else { |
} else { |
$message = "<b>".&mt('You are correct.')."</b>"; |
$message = "<b>".&mt('You are correct.')."</b>"; |
$message.=" ".&mt("Computer's answer now shown above."); |
$message.= $computer; |
} |
} |
$added_computer_text=1; |
$added_computer_text=1; |
unless ($env{'course.'. |
unless ($env{'course.'. |
Line 601 sub decideoutput {
|
Line 625 sub decideoutput {
|
} |
} |
if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' && |
if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' && |
!$added_computer_text && $target ne 'tex') { |
!$added_computer_text && $target ne 'tex') { |
$message.=" ".&mt("Computer's answer now shown above."); |
$message.= $computer; |
$added_computer_text=1; |
$added_computer_text=1; |
} |
} |
return ($button,$bgcolor,$message,$previousmsg); |
return ($button,$bgcolor,$message,$previousmsg); |