[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 23 Nov 2004 14:19:33 -0000


albertel		Tue Nov 23 09:19:33 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - probably cleaners
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.230 loncom/homework/grades.pm:1.231
--- loncom/homework/grades.pm:1.230	Mon Nov 22 21:37:58 2004
+++ loncom/homework/grades.pm	Tue Nov 23 09:19:32 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.230 2004/11/23 02:37:58 banghart Exp $
+# $Id: grades.pm,v 1.231 2004/11/23 14:19:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1663,7 +1663,6 @@
 			}
 		    }
 		    my $order=&get_order($partid,$respid,$symb,$uname,$udom);
-		    my $portfolio_path;
 		    if ($ENV{'form.lastSub'} eq 'lastonly' || 
 			($ENV{'form.lastSub'} eq 'hdgrade' && 
 			 $$handgrade{$part} eq 'yes')) {
@@ -1671,20 +1670,17 @@
 			$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '.
 			    $display_part.' <font color="#999999">( ID '.$respid.
 			    ' )</font>&nbsp; &nbsp;';
+			my $file_url;
 			if ($record{"resource.$partid.$respid.portfiles"}) {
-			    $portfolio_path = '/uploaded/'.$udom.'/'.$uname.'/portfolio';
+			    $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio'.$record{"resource.$partid.$respid.portfiles"};
 			    &Apache::lonnet::logthis("found a portfolio file".$record{"resource.$partid.$respid.portfiles"});
 			    &Apache::lonnet::logthis("uploaded URL file".$record{"resource.$partid.$respid.uploadedurl"});
 			} else {
-			    $portfolio_path = '';
+			    $file_url=$record{"resource.$partid.$respid.uploadedurl"};
 			}
-			if ($record{"resource.$partid.$respid.uploadedurl"}) {
-			    &Apache::lonnet::allowuploaded('/adm/grades',
-			    $record{"resource.$partid.$respid.uploadedurl"});
-			    $lastsubonly.='<a href="'.$portfolio_path.$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 />';
-			}
-			if ($record{"resource.$partid.$respid.portfiles"}) {
-			    $lastsubonly.='<a href="'.$portfolio_path.$record{"resource.$partid.$respid.portfiles"}.'" 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 />';
+			if ($file_url) {
+			    &Apache::lonnet::allowuploaded('/adm/grades',$file_url);
+			    $lastsubonly.='<a href="'.$file_url.'" 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,