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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 07 Apr 2003 23:02:07 -0000


albertel		Mon Apr  7 19:02:07 2003 EDT

  Modified files:              
    /loncom/homework	hint.pm 
  Log:
  - logic was incorrect here, so sometimes endredirection was called when startredirection wasn't
  
  
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.37 loncom/homework/hint.pm:1.38
--- loncom/homework/hint.pm:1.37	Wed Apr  2 13:51:11 2003
+++ loncom/homework/hint.pm	Mon Apr  7 19:02:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.37 2003/04/02 18:51:11 sakharuk Exp $
+# $Id: hint.pm,v 1.38 2003/04/07 23:02:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -50,14 +50,14 @@
     my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");
     if ( $hinttries eq '') { $hinttries = 1; }
     &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
-    if ( $numtries < $hinttries ) {
-      $skiptoend='1';
-    } else {
-	if ($target eq 'web' && $Apache::lonhomework::type ne 'exam') {
-          $result='<table bgcolor="#dddddd"><tr><td>';
-        } elsif ($Apache::lonhomework::type eq 'exam') {
-	  &Apache::lonxml::startredirection;
+    if ($Apache::lonhomework::type ne 'exam') {
+	if ( $numtries < $hinttries ) {
+	    $skiptoend='1';
+	} else {
+	    $result='<table bgcolor="#dddddd"><tr><td>';
 	}
+    } else {
+	&Apache::lonxml::startredirection;
     }
     if ($skiptoend) {
       &Apache::lonxml::get_all_text("/hintgroup",$parser);
@@ -80,10 +80,12 @@
     my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");
     if ( $hinttries eq '') { $hinttries = 1; }
     &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
-    if ( $numtries >= $hinttries && $Apache::lonhomework::type ne 'exam') {
-      $result='</td></tr></table>';
-    } elsif ($Apache::lonhomework::type eq 'exam') {
-      my $garbage = &Apache::lonxml::endredirection;
+    if ($Apache::lonhomework::type ne 'exam') {
+	if ( $numtries >= $hinttries ) {
+	    $result='</td></tr></table>';
+	}
+    } else {
+	&Apache::lonxml::endredirection;
     }
   } elsif ($target eq 'edit') {
     $result.=&Apache::edit::end_table();