--- loncom/homework/grades.pm	2003/11/25 21:44:45	1.162
+++ loncom/homework/grades.pm	2003/12/02 04:50:26	1.165
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.162 2003/11/25 21:44:45 albertel Exp $
+# $Id: grades.pm,v 1.165 2003/12/02 04:50:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -678,10 +678,11 @@ LISTJAVASCRIPT
 	if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
 	    (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
 	    my $submitted = 0;
-	    my $graded = 1;
+	    my $graded = 0;
 	    foreach (keys(%status)) {
 		$submitted = 1 if ($status{$_} ne 'nothing');
-		$graded = 0 if ($status{$_} =~ /^correct/);
+		$graded = 1 if ($status{$_} !~ /^correct/);
+
 		my ($foo,$partid,$foo1) = split(/\./,$_);
 		if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
 		    $submitted = 0;
@@ -1375,7 +1376,9 @@ sub submission {
 	return;
     }
 
-    $ENV{'form.lastSub'} = ($ENV{'form.lastSub'} eq '' ? 'datesub' : $ENV{'form.lastSub'});
+    if (!$ENV{'form.lastSub'}) { $ENV{'form.lastSub'} = 'datesub'; }
+    if (!$ENV{'form.vProb'}) { $ENV{'form.vProb'} = 'yes'; }
+    if (!$ENV{'form.vAns'}) { $ENV{'form.vAns'} = 'yes'; }
     my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
     my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL').
 	'/check.gif" height="16" border="0" />';
@@ -1644,7 +1647,7 @@ KEYWORDS
 			    $partid.'</b> <font color="#999999">( ID '.$respid.
 			    ' )</font>&nbsp; &nbsp;';
 			if ($record{"resource.$partid.$respid.uploadedurl"}) {
-			    $lastsubonly.='<a href="'.&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}).'"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> <font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />';
+			    $lastsubonly.='<a href="'.&Apache::lonnet::tokenwrapper($record{"resource.$partid.$respid.uploadedurl"}).'" target="lonGRDs"><img src="/adm/lonIcons/unknown.gif" border=0"> File uploaded by student</a> <font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />';
 			}
 			$lastsubonly.='<b>Submitted Answer: </b>'.
 			    &cleanRecord($subval,$responsetype,$symb,$partid,