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

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


albertel		Wed Mar  8 20:13:17 2006 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - some small cleanups to stringresponse
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.188 loncom/homework/caparesponse/caparesponse.pm:1.189
--- loncom/homework/caparesponse/caparesponse.pm:1.188	Wed Mar  8 19:41:13 2006
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Mar  8 20:13:16 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.188 2006/03/09 00:41:13 albertel Exp $
+# $Id: caparesponse.pm,v 1.189 2006/03/09 01:13:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -776,7 +776,7 @@
 
 sub end_stringresponse {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    my $increment=1;
+
     my $result = '';
     my $part=$Apache::inputtags::part;
     my $id=$Apache::inputtags::response[-1];
@@ -792,7 +792,8 @@
 	$safeeval->share_from('capa',['&caparesponse_capa_check_answer']);
 	if ($Apache::lonhomework::type eq 'exam' ||
 	    &Apache::response::submitted('scantron')) {
-	    $increment=&Apache::response::scored_response($part,$id);
+	    &Apache::response::scored_response($part,$id);
+
 	} else {
 	    my $response = &Apache::response::getresponse();
 	    if ( $response =~ /[^\s]/) {
@@ -898,7 +899,7 @@
     }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
 	$target eq 'tex' || $target eq 'analyze') {
-	&Apache::lonxml::increment_counter($increment);
+	&Apache::lonxml::increment_counter(&Apache::response::repetition());
     }
     &Apache::response::end_response;
     return $result;