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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 09 Mar 2006 01:07:06 -0000


albertel		Wed Mar  8 20:07:06 2006 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
  - essay response emits an answer line now and consumes correct number of lines
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.69 loncom/homework/essayresponse.pm:1.70
--- loncom/homework/essayresponse.pm:1.69	Tue Nov 15 17:19:57 2005
+++ loncom/homework/essayresponse.pm	Wed Mar  8 20:07:04 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.69 2005/11/15 22:19:57 albertel Exp $
+# $Id: essayresponse.pm,v 1.70 2006/03/09 01:07:04 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -80,7 +80,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $part          = $Apache::inputtags::part;
     my $id            = $Apache::inputtags::response[-1];
-    my $increment     = 1;
+    my $increment     = &Apache::response::repetition();
     my $result;
     if ( $target eq 'grade' ) {
 	my $collaborators = $env{'form.HWCOL'.$part.'_'.$id};	
@@ -142,6 +142,10 @@
 	    $result.= '\end{enumerate}';
 	    $increment=$repetition;
 	}
+    } elsif ($target eq 'answer') {
+	$result.=&Apache::response::answer_header($$tagstack[-1]);
+	$result.=&Apache::response::answer_part($$tagstack[-1],'');
+	$result.=&Apache::response::answer_footer($$tagstack[-1]);
     }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
 	$target eq 'tex' || $target eq 'analyze') {