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

kruse kruse at source.lon-capa.org
Mon Jan 13 08:20:33 EST 2014


kruse		Mon Jan 13 13:20:33 2014 EDT

  Modified files:              
    /loncom/homework	externalresponse.pm 
  Log:
  Corrected bug that resulted in interpreting textfield submissions in external response
  as draft and not as actual submission. This bug occured in changes made in revisions 1.20 / 1.21 .
  
  
Index: loncom/homework/externalresponse.pm
diff -u loncom/homework/externalresponse.pm:1.24 loncom/homework/externalresponse.pm:1.25
--- loncom/homework/externalresponse.pm:1.24	Wed Sep 11 10:25:50 2013
+++ loncom/homework/externalresponse.pm	Mon Jan 13 13:20:33 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # external style responses
 #
-# $Id: externalresponse.pm,v 1.24 2013/09/11 10:25:50 kruse Exp $
+# $Id: externalresponse.pm,v 1.25 2014/01/13 13:20:33 kruse Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -173,6 +173,7 @@
 sub end_externalresponse {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
+    my $response;
     my $part=$Apache::inputtags::part;
     my $id = $Apache::inputtags::response['-1'];
     my $increment     = 1;
@@ -180,7 +181,7 @@
 	if (  &Apache::response::submitted('scantron') ) {
 	    my $increment=&Apache::response::scored_response($part,$id);
 	} elsif ( &Apache::response::submitted() ) {
-            my $response      = $env{'form.HWVAL_'.$id};
+            $response      = $env{'form.HWVAL_'.$id};
             my $jspart=$part;
             $jspart=~s/\./_/g;
             my $filename = $env{'form.HWFILE'.$jspart.'_'.$id.'.filename'} ||
@@ -194,7 +195,7 @@
             if ($Apache::lonhomework::history{"resource.$part.award"} eq 'DRAFT') {
                 $was_draft = 1;
             }
-            if (($response =~ /[^\s]/) || ($filename =~ /[^\s]/) || ($portfiles =~ /[^\s]/) ||
+            if (($filename =~ /[^\s]/) || ($portfiles =~ /[^\s]/) ||
                 (@deletions > 0) || ($was_draft && $is_submit)) {
                 my $award='DRAFT';
                 if ($env{'form.HWDRAFT'.$part.'_'.$id} eq 'yes') {
@@ -239,9 +240,12 @@
                 }
             ($award eq 'DRAFT') ? ($externalgrade = 0) : ($externalgrade =1);
             }
-          if($externalgrade){
-	    my $response = &Apache::response::getresponse();
+          if (&Apache::response::getresponse() =~ /[^\s]/) {
+               $response = &Apache::response::getresponse();
+               $externalgrade = 1;
+          }  
 
+          if ($externalgrade) {
             my $filesresults=0;
 # Previously turned in files
             my %previously_turned_in=();




More information about the LON-CAPA-cvs mailing list