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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 02 Apr 2003 18:51:11 -0000


sakharuk		Wed Apr  2 13:51:11 2003 EDT

  Modified files:              
    /loncom/homework	hint.pm 
  Log:
   In the exam mode (on-line) hints not appear on the screen.
  
  
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.36 loncom/homework/hint.pm:1.37
--- loncom/homework/hint.pm:1.36	Sun Feb 23 15:37:56 2003
+++ loncom/homework/hint.pm	Wed Apr  2 13:51:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.36 2003/02/23 20:37:56 www Exp $
+# $Id: hint.pm,v 1.37 2003/04/02 18:51:11 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,7 +53,11 @@
     if ( $numtries < $hinttries ) {
       $skiptoend='1';
     } else {
-      if ($target eq 'web') {$result='<table bgcolor="#dddddd"><tr><td>';}
+	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 ($skiptoend) {
       &Apache::lonxml::get_all_text("/hintgroup",$parser);
@@ -76,8 +80,10 @@
     my $hinttries=&Apache::lonnet::EXT("resource.$id.hinttries");
     if ( $hinttries eq '') { $hinttries = 1; }
     &Apache::lonxml::debug("found :$id:$numtries:$hinttries:");
-    if ( $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;
     }
   } elsif ($target eq 'edit') {
     $result.=&Apache::edit::end_table();