version 1.107, 2003/06/24 19:18:01
|
version 1.114.2.4, 2003/10/15 22:20:13
|
Line 343 sub decideoutput {
|
Line 343 sub decideoutput {
|
} else { |
} else { |
$message = "<b>You are correct.</b>"; |
$message = "<b>You are correct.</b>"; |
} |
} |
$message.=' Your receipt is '.&Apache::lonnet::receipt; |
unless ($ENV{'course.'. |
|
$ENV{'request.course.id'}. |
|
'.disable_receipt_display'} eq 'yes') { |
|
$message.=(($target eq 'web')?'<br />':' '). |
|
'Your receipt is '.&Apache::lonnet::receipt(). |
|
(($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); |
|
} |
} |
} |
$bgcolor=$possiblecolors{'correct'}; |
$bgcolor=$possiblecolors{'correct'}; |
$button=0; |
$button=0; |
$previousmsg=''; |
$previousmsg=''; |
} elsif ($solved =~ /^excused/) { |
} elsif ($solved =~ /^excused/) { |
$message = "<b>You are excused from the problem.</b>"; |
if ($target eq 'tex') { |
|
$message = ' \textbf{You are excused from the problem.} '; |
|
} else { |
|
$message = "<b>You are excused from the problem.</b>"; |
|
} |
$bgcolor=$possiblecolors{'charged_try'}; |
$bgcolor=$possiblecolors{'charged_try'}; |
$button=0; |
$button=0; |
$previousmsg=''; |
$previousmsg=''; |
Line 359 sub decideoutput {
|
Line 369 sub decideoutput {
|
$bgcolor=$possiblecolors{'charged_try'}; |
$bgcolor=$possiblecolors{'charged_try'}; |
$button=1; |
$button=1; |
} else { |
} else { |
$message = "<b>You are correct.</b> Your receipt is ". |
$message = "<b>You are correct.</b>"; |
&Apache::lonnet::receipt; |
unless ($ENV{'course.'. |
|
$ENV{'request.course.id'}. |
|
'.disable_receipt_display'} eq 'yes') { |
|
$message.=(($target eq 'web')?'<br />':' '). |
|
'Your receipt is '.&Apache::lonnet::receipt(). |
|
(($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):''); |
|
} |
$bgcolor=$possiblecolors{'correct'}; |
$bgcolor=$possiblecolors{'correct'}; |
$button=0; |
$button=0; |
$previousmsg=''; |
$previousmsg=''; |
Line 386 sub decideoutput {
|
Line 402 sub decideoutput {
|
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'MISORDERED_RANK') { |
} elsif ($award eq 'MISORDERED_RANK') { |
$message = 'You have provided an invalid ranking, please refer to '. |
$message = 'You have provided an invalid ranking'; |
&Apache::loncommon::help_open_topic('Ranking_Problems','help on ranking problems').'.'; |
if ($target ne 'tex') { |
|
$message.=', please refer to '.&Apache::loncommon::help_open_topic('Ranking_Problems','help on ranking problems').'.'; |
|
} |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'INVALID_FILETYPE') { |
} elsif ($award eq 'INVALID_FILETYPE') { |
Line 399 sub decideoutput {
|
Line 417 sub decideoutput {
|
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'UNIT_FAIL') { |
} elsif ($award eq 'UNIT_FAIL') { |
$message = "Units incorrect. ". |
$message = "Units incorrect. "; |
&Apache::loncommon::help_open_topic('Physical_Units'); #Computer reads units as %s"; |
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');} #Computer reads units as %s"; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'UNIT_NOTNEEDED') { |
} elsif ($award eq 'UNIT_NOTNEEDED') { |
Line 408 sub decideoutput {
|
Line 426 sub decideoutput {
|
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'NO_UNIT') { |
} elsif ($award eq 'NO_UNIT') { |
$message = "Units required". |
$message = "Units required"; |
&Apache::loncommon::help_open_topic('Physical_Units'); |
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units')}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$bgcolor=$possiblecolors{'not_charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'BAD_FORMULA') { |
} elsif ($award eq 'BAD_FORMULA') { |
Line 436 sub decideoutput {
|
Line 454 sub decideoutput {
|
$message = "Unknown message: $award"; |
$message = "Unknown message: $award"; |
$button=1; |
$button=1; |
} |
} |
if (lc($Apache::lonhomework::problemstatus) eq 'no') { |
if (lc($Apache::lonhomework::problemstatus) eq 'no' && |
|
$Apache::inputtags::status[-1] ne 'SHOW_ANSWER') { |
$message = "Answer Submitted"; |
$message = "Answer Submitted"; |
$bgcolor=$possiblecolors{'correct'}; |
$bgcolor=$possiblecolors{'correct'}; |
$button=1; |
$button=1; |
Line 498 sub setgradedata {
|
Line 517 sub setgradedata {
|
} elsif ( $award eq 'INCORRECT' ) { |
} elsif ( $award eq 'INCORRECT' ) { |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
|
if (lc($Apache::lonhomework::problemstatus) eq 'no') { |
|
$Apache::lonhomework::results{"resource.$id.awarded"} = 0; |
|
} |
$Apache::lonhomework::results{"resource.$id.solved"} = |
$Apache::lonhomework::results{"resource.$id.solved"} = |
'incorrect_attempted' |
'incorrect_attempted' |
} elsif ( $award eq 'SUBMITTED' ) { |
} elsif ( $award eq 'SUBMITTED' ) { |
Line 517 sub setgradedata {
|
Line 539 sub setgradedata {
|
if (lc($Apache::lonhomework::problemstatus) eq 'no') { |
if (lc($Apache::lonhomework::problemstatus) eq 'no') { |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
|
$Apache::lonhomework::results{"resource.$id.awarded"} = 0; |
} |
} |
} |
} |
|
|
Line 597 sub gradestatus {
|
Line 620 sub gradestatus {
|
|
|
my $status = $Apache::inputtags::status['-1']; |
my $status = $Apache::inputtags::status['-1']; |
&Apache::lonxml::debug("gradestatus has :$status:"); |
&Apache::lonxml::debug("gradestatus has :$status:"); |
if ( $status ne 'CLOSED' && $status ne 'UNAVAILABLE') { |
if ( $status ne 'CLOSED' && $status ne 'UNAVAILABLE' && |
|
$status ne 'INVALID_ACCESS') { |
my $award = $Apache::lonhomework::history{"resource.$id.award"}; |
my $award = $Apache::lonhomework::history{"resource.$id.award"}; |
my $solved = $Apache::lonhomework::history{"resource.$id.solved"}; |
my $solved = $Apache::lonhomework::history{"resource.$id.solved"}; |
my $previous = $Apache::lonhomework::history{"resource.$id.previous"}; |
my $previous = $Apache::lonhomework::history{"resource.$id.previous"}; |
&Apache::lonxml::debug("Found Award |$award|$solved|"); |
&Apache::lonxml::debug("Found Award |$award|$solved|"); |
if ( $award ne '' ) { |
if ( $award ne '' || $solved ne '') { |
&Apache::lonxml::debug('Getting message'); |
&Apache::lonxml::debug('Getting message'); |
($showbutton,$bgcolor,$message,$previousmsg) = |
($showbutton,$bgcolor,$message,$previousmsg) = |
&decideoutput($award,$solved,$previous,$target); |
&decideoutput($award,$solved,$previous,$target); |