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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 06 May 2003 15:48:55 -0000


albertel		Tue May  6 11:48:55 2003 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  - in my attempts to retabinate I screwed up the logic, web tex and grade should work correctly again
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.27 loncom/homework/imageresponse.pm:1.28
--- loncom/homework/imageresponse.pm:1.27	Tue May  6 07:54:08 2003
+++ loncom/homework/imageresponse.pm	Tue May  6 11:48:55 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.27 2003/05/06 11:54:08 www Exp $
+# $Id: imageresponse.pm,v 1.28 2003/05/06 15:48:55 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,8 +103,10 @@
   my $temp=1;
   foreach $name (@whichopt) {
     $result.=$Apache::response::foilgroup{"$name.text"};
+    &Apache::lonxml::debug("Text is $result");
     if ($target eq 'tex') {$result.="\\vskip 0 mm \n";} else {$result.="<br />\n";}
     my $image=$Apache::response::foilgroup{"$name.image"};
+    &Apache::lonxml::debug("image is $image");
     if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) {
       if ($target eq 'tex') {
 	$result.=$Apache::response::foilgroup{"$name.image"}."\\vskip 0 mm \n";
@@ -170,12 +172,11 @@
     if ($count>$max) { $count=$max }
     &Apache::lonxml::debug("Count is $count from $max");
     @whichopt = &whichfoils($max);
-  } elsif ($target eq 'web' || $target eq 'tex') {
-    $result=&displayfoils($target,@whichopt);
-  } elsif ($target eq 'grade') {
-    if ( defined $ENV{'form.submitted'}) {
-      &gradefoils(@whichopt);
-    }
+    if ($target eq 'web' || $target eq 'tex') {
+	$result=&displayfoils($target,@whichopt);
+    } elsif ($target eq 'grade') {
+	if ( defined $ENV{'form.submitted'}) { &gradefoils(@whichopt); }
+    } 
   } elsif ($target eq 'edit') {
       $result=&Apache::edit::end_table();
   }