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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 21 Dec 2005 19:05:06 -0000


albertel		Wed Dec 21 14:05:06 2005 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - allow students who have passed a BT to see the BT
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.230 loncom/homework/lonhomework.pm:1.231
--- loncom/homework/lonhomework.pm:1.230	Wed Dec 21 12:53:25 2005
+++ loncom/homework/lonhomework.pm	Wed Dec 21 14:05:05 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.230 2005/12/21 17:53:25 albertel Exp $
+# $Id: lonhomework.pm,v 1.231 2005/12/21 19:05:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -295,22 +295,23 @@
 	$slotstatus='CAN_ANSWER';
     }
 
-    my ($pass_status,$checkedin);
+    my ($got_grade,$checkedin);
     if ($type eq 'Task') {
 	my $version=$Apache::lonhomework::history{'resource.0.version'};
-	$pass_status = 
-	    $Apache::lonhomework::history{"resource.$version.0.status"} eq 'fail';
+	$got_grade = 
+	    ($Apache::lonhomework::history{"resource.$version.0.status"} 
+	     =~ /^(?:pass|fail)$/);
 	$checkedin =
 	    $Apache::lonhomework::history{"resource.$version.0.checkedin"};
     } elsif ($type eq 'problem') {
-	$pass_status = 1;
+	$got_grade = 1;
 	$checkedin = $Apache::lonhomework::history{"resource.0.checkedin"};
     }
     
     if ($slotstatus eq 'NOT_IN_A_SLOT' 
 	&& $checkedin ) {
 
-	if ($pass_status) {
+	if ($got_grade) {
 	    return ('SHOW_ANSWER');
 	} else {
 	    return ('WAITING_FOR_GRADE');