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

kruse kruse at source.lon-capa.org
Wed Sep 11 06:25:50 EDT 2013


kruse		Wed Sep 11 10:25:50 2013 EDT

  Modified files:              
    /loncom/homework	externalresponse.pm 
  Log:
  WORK IN PROGRESS, preparing handbackfiles offered by external grader to be saved in portfolio
  
  
Index: loncom/homework/externalresponse.pm
diff -u loncom/homework/externalresponse.pm:1.23 loncom/homework/externalresponse.pm:1.24
--- loncom/homework/externalresponse.pm:1.23	Thu Aug 22 13:58:21 2013
+++ loncom/homework/externalresponse.pm	Wed Sep 11 10:25:50 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # external style responses
 #
-# $Id: externalresponse.pm,v 1.23 2013/08/22 13:58:21 kruse Exp $
+# $Id: externalresponse.pm,v 1.24 2013/09/11 10:25:50 kruse Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -187,7 +187,7 @@
                            $env{'form.HWFILETOOBIG'.$part.'_'.$id};
             my $portfiles = $env{'form.HWPORT'.$jspart.'_'.$id};
             my @deletions = &Apache::loncommon::get_env_multiple('form.HWFILE'.$jspart.'_'.$id.'_delete');
-            my ($is_submit,$was_draft);
+            my ($is_submit,$was_draft,$externalgrade);
             if ($env{'form.HWDRAFT'.$part.'_'.$id} eq 'yes') {
                  $is_submit = 1;
             }
@@ -237,7 +237,9 @@
                                          { $akey => $response },$adom,$aname);
                     }
                 }
+            ($award eq 'DRAFT') ? ($externalgrade = 0) : ($externalgrade =1);
             }
+          if($externalgrade){
 	    my $response = &Apache::response::getresponse();
 
             my $filesresults=0;
@@ -263,7 +265,7 @@
             &Apache::lonnet::logthis("Currently: ".join("\n",sort(keys(%currently_turned_in))));
             &Apache::lonnet::logthis("File flag: ".$filesresults);
             &Apache::lonnet::logthis("Links String: ".$filelinks);
-	    if (( $response =~ /[^\s]/) ||  $filesresults ) {
+	    if ($filesresults || ( $response =~ /[^\s]/)  ) {
 		my $url = &Apache::lonxml::get_param('url',$parstack,$safeeval);
 		my $answer = &Apache::lonxml::get_param('answer',$parstack,$safeeval);
 		my %form = &Apache::lonxml::get_param_var('form',$parstack,$safeeval);
@@ -300,6 +302,8 @@
                    $Apache::lonhomework::results{"resource.$part.$id.awarded"}=
                         1.*$Apache::loncapagrade::results{"awarded"};
                 }
+                my $handbackurl = $Apache::loncapagrade::results{'handbackurl'}
+                &Apache::lonnet::logthis("handbackurl: ". $Apache::loncapagrade::results{'handbackurl'});
 		&Apache::lonxml::debug("response of");
 		&Apache::lonhomework::showhash(%$res);
 		&Apache::lonxml::debug("capagrade of");
@@ -308,6 +312,7 @@
 		&Apache::lonhomework::showhash(%Apache::lonhomework::results);
 	    }
         }
+      }
     }
     if ($target eq 'web')  {
         &Apache::response::setup_prior_tries_hash(\&Apache::essayresponse::format_prior_response,




More information about the LON-CAPA-cvs mailing list