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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 05 Jun 2006 18:53:07 -0000


banghart		Mon Jun  5 14:53:07 2006 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  	Show handback files to student at problem grading.
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.193 loncom/homework/inputtags.pm:1.194
--- loncom/homework/inputtags.pm:1.193	Tue May 30 14:08:35 2006
+++ loncom/homework/inputtags.pm	Mon Jun  5 14:53:03 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.193 2006/05/30 18:08:35 albertel Exp $
+# $Id: inputtags.pm,v 1.194 2006/06/05 18:53:03 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -447,6 +447,7 @@
 		push(@filelist,'<a href="'.$url.'"><img src="'.$icon.
 		     '" border="0" />'.$file.'</a>');
 		if (! &Apache::lonnet::stat_file($url)) {
+		    &Apache::lonnet::logthis("bad file is $url");
 		    push(@bad_file_list,'<a href="'.$url.'"><img src="'.$icon.
 			 '" border="0" />'.$file.'</a>');
 		}
@@ -548,8 +549,8 @@
 
     if ($previous) { $previousmsg=&mt('You have entered that answer before'); }
     
-    if      ($solved =~ /^correct/) {
-	$bgcolor=$possiblecolors{'correct'};
+    if ($solved =~ /^correct/) {
+        $bgcolor=$possiblecolors{'correct'};
 	$message=&mt('You are correct.');
 	if ($awarded < 1 && $awarded > 0) {
 	    $message=&mt('You are partially correct.');
@@ -716,6 +717,14 @@
 	$message = &mt("Unknown message").": $award";
 	$button=1;
     }
+    my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+    foreach my $resid(@Apache::inputtags::response){
+        &Apache::lonnet::logthis("handback is ".$Apache::lonhomework::history{"resource.$part.$resid.handback"});
+        if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
+            $message.= '<br /><a href="/uploaded/'."$domain/$user".'/portfolio/'.$Apache::lonhomework::history{"resource.$part.$resid.handback"}.'">Returned File</a>';
+        }
+    }
+
     if (lc($Apache::lonhomework::problemstatus) eq 'no'  && 
 	$Apache::inputtags::status[-1] ne 'SHOW_ANSWER') {
 	$message = &mt("Answer Submitted: Your final submission will be graded after the due date.");