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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 23 Nov 2004 02:37:58 -0000


banghart		Mon Nov 22 21:37:58 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Next step toward permitting portfolio files to be viewed in grading essays.
  	Not thoroughly tested. Needs support for multiple files submitted.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.229 loncom/homework/grades.pm:1.230
--- loncom/homework/grades.pm:1.229	Wed Nov 17 15:42:35 2004
+++ loncom/homework/grades.pm	Mon Nov 22 21:37:58 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.229 2004/11/17 20:42:35 albertel Exp $
+# $Id: grades.pm,v 1.230 2004/11/23 02:37:58 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1663,6 +1663,7 @@
 			}
 		    }
 		    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')) {
@@ -1670,10 +1671,20 @@
 			$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part:</b> '.
 			    $display_part.' <font color="#999999">( ID '.$respid.
 			    ' )</font>&nbsp; &nbsp;';
+			if ($record{"resource.$partid.$respid.portfiles"}) {
+			    $portfolio_path = '/uploaded/'.$udom.'/'.$uname.'/portfolio';
+			    &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 = '';
+			}
 			if ($record{"resource.$partid.$respid.uploadedurl"}) {
 			    &Apache::lonnet::allowuploaded('/adm/grades',
-			      $record{"resource.$partid.$respid.uploadedurl"});
-			    $lastsubonly.='<a href="'.$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 />';
+			    $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 />';
 			}
 			$lastsubonly.='<b>Submitted Answer: </b>'.
 			    &cleanRecord($subval,$responsetype,$symb,$partid,