[LON-CAPA-cvs] cvs: loncom(version_1_0_2) /interface lonnavmaps.pm lonquickgrades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 23 Sep 2003 22:42:26 -0000


albertel		Tue Sep 23 18:42:26 2003 EDT

  Modified files:              (Branch: version_1_0_2)
    /loncom/interface	lonnavmaps.pm lonquickgrades.pm 
  Log:
  - patches from Jeremy to fix quickgrades and navmaps to stop bleeding or hiding info in no problem status mode
  
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.219.2.1 loncom/interface/lonnavmaps.pm:1.219.2.1.2.1
--- loncom/interface/lonnavmaps.pm:1.219.2.1	Thu Aug 21 14:29:54 2003
+++ loncom/interface/lonnavmaps.pm	Tue Sep 23 18:42:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.219.2.1 2003/08/21 18:29:54 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.219.2.1.2.1 2003/09/23 22:42:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3902,6 +3902,11 @@
     if ($completionStatus == NETWORK_FAILURE) { return NETWORK_FAILURE; }
 
     my $suppressFeedback = lc($self->parmval("problemstatus", $part)) eq 'no';
+    # If there's an answer date and we're past it, don't
+    # suppress the feedback; student should know
+    if ($self->answerdate($part) && $self->answerdate($part) < time()) {
+	$suppressFeedback = 0;
+    }
 
     # There are a few whole rows we can dispose of:
     if ($completionStatus == CORRECT ||
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.22.2.1 loncom/interface/lonquickgrades.pm:1.22.2.2
--- loncom/interface/lonquickgrades.pm:1.22.2.1	Mon Sep 22 21:52:57 2003
+++ loncom/interface/lonquickgrades.pm	Tue Sep 23 18:42:26 2003
@@ -136,11 +136,23 @@
             my $stack = $iterator->getStack();
             
             for my $part (@{$parts}) {
-                if ($curRes->getCompletionStatus($part) == $curRes->EXCUSED()) {
+		my $completionStatus = $curRes->getCompletionStatus($part);
+		my $dateStatus = $curRes->getDateStatus($part);
+                if ($completionStatus == $curRes->EXCUSED()) {
                     next;
                 }
 		if ($showPoints) {
-		    my $score = $curRes->weight($part) * $curRes->awarded($part);
+		    my $score;
+		    # If we're not telling status and the answer date isn't
+		    # passed yet
+		    if (($curRes->problemstatus($part) eq 'no') &&
+			($dateStatus != $curRes->ANSWER_OPEN)) {
+			$score = 0;
+		    } else {
+			$score = $curRes->weight($part) * 
+			    $curRes->awarded($part);
+		    }
+
 		    $partsRight += $score;
 		    $totalRight += $score;
 		    $partsCount += $curRes->weight($part);
@@ -160,7 +172,6 @@
 			$thisright = 1;
 		    }
 		    
-		    my $dateStatus = $curRes->getDateStatus($part);
 		    $totalParts++;
 		    if ($curRes->opendate($part) < $now) {
 			$totalPossible++;