'."\n".
&Apache::loncommon::end_data_table_row();
@@ -635,7 +678,7 @@ sub current_file_submissions {
if ($header_shown) {
$result .= &Apache::loncommon::end_data_table().
' '.
- &mt('Items checked for deletion will not be included amongst the files evaluated when your submission is graded.').'';
+ &mt('Exclude existing file(s) from grading by checking the "Delete?" checkbox(es) and clicking "Submit Answer"').'';
}
if (@bad_file_list) {
my $bad_files = ''.
@@ -801,7 +844,7 @@ sub finalizeawards {
}
sub decideoutput {
- my ($award,$awarded,$awardmsg,$solved,$previous,$target)=@_;
+ my ($award,$awarded,$awardmsg,$solved,$previous,$target,$nocorrect)=@_;
my $message='';
my $button=0;
@@ -819,8 +862,14 @@ sub decideoutput {
my $part = $Apache::inputtags::part;
my $tohandgrade = &Apache::lonnet::EXT("resource.$part.handgrade");
my $handgrade = ('yes' eq lc($tohandgrade));
+#
+# Should "Computer's Answer" be displayed?
+# Should not be displayed if still answerable,
+# if the problem is handgraded,
+# or if the problem does not give a correct answer
+#
- my $computer = ($handgrade)? ''
+ my $computer = ($handgrade || $nocorrect)? ''
: " ".&mt("Computer's answer now shown above.");
&Apache::lonxml::debug("handgrade has :$handgrade:");
@@ -862,7 +911,7 @@ sub decideoutput {
}
}
}
- $button=0;
+ if ($awarded==1) { $button=0; } else { $button=1; }
$previousmsg='';
} elsif ($solved =~ /^excused/) {
if ($target eq 'tex') {
@@ -1088,7 +1137,6 @@ sub decideoutput {
}
$message.=&mt('Submissions to practice problems are not permanently recorded.');
}
-
return ($button,$css_class,$message,$previousmsg);
}
@@ -1141,8 +1189,7 @@ sub setgradedata {
$Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') {
$Apache::lonhomework::results{"resource.$id.afterduedate"}=$award;
return '';
- } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} !~
- /^correct/
+ } elsif ( $Apache::lonhomework::history{"resource.$id.awarded"} < 1
|| $Apache::lonhomework::scantronmode
|| &Apache::lonhomework::hide_problem_status() ) {
# the student doesn't already have it correct,
@@ -1263,8 +1310,7 @@ sub setgradedata {
$Apache::lonhomework::results{"resource.$id.previous"} = '0';
}
}
- } elsif ( $Apache::lonhomework::history{"resource.$id.solved"} =~
- /^correct/ ) {
+ } elsif ( $Apache::lonhomework::history{"resource.$id.awarded"} == 1 ) {
#delete all data as they student already has it correct
&removealldata($id);
#and since they didn't do anything we were never here
@@ -1358,8 +1404,8 @@ sub grade {
}
sub get_grade_messages {
- my ($id,$prefix,$target,$status) = @_;
-
+ my ($id,$prefix,$target,$status,$nocorrect) = @_;
+# nocorrect suppresses "Computer's answer now shown above"
my ($message,$latemessage,$trystr,$previousmsg);
my $showbutton = 1;
@@ -1373,7 +1419,7 @@ sub get_grade_messages {
&Apache::lonxml::debug('Getting message');
($showbutton,my $css_class,$message,$previousmsg) =
&decideoutput($award,$awarded,$awardmsg,$solved,$previous,
- $target);
+ $target,(($status eq 'CAN_ANSWER') || $nocorrect));
if ($target eq 'tex') {
$message='\vskip 2 mm '.$message.' ';
} else {
@@ -1406,7 +1452,7 @@ sub get_grade_messages {
$trystr = '
'.&mt($tries_text)." $tries";
if ($Apache::lonhomework::parsing_a_task) {
} elsif($env{'request.state'} ne 'construct') {
- $trystr.="/$maxtries";
+ $trystr.="/".&Apache::lonhtmlcommon::direct_parm_link($maxtries,$env{'request.symb'},'maxtries',$id,$target);
} else {
if (defined($Apache::inputtags::params{'maxtries'})) {
$trystr.="/".$Apache::inputtags::params{'maxtries'};
@@ -1519,6 +1565,16 @@ sub previous_tries {
) {
my $txt_correct = &mt('Correct');
+ my $awarded = $Apache::lonhomework::history{"$prefix.awarded"};
+ if ($awarded < 1 && $awarded > 0) {
+ $txt_correct=&mt('Partially Correct');
+ } elsif ($awarded < 1) {
+ if ($awarded eq '') {
+ $txt_correct='';
+ } else {
+ $txt_correct=&mt('Incorrect');
+ }
+ }
$message =~ s{(