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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 21 Nov 2003 22:59:42 -0000


albertel		Fri Nov 21 17:59:42 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - Removing some invalid FIXMEs and some commented out garbage
  -BUG#2406, warning about redfinition of a subroutine
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.160 loncom/homework/grades.pm:1.161
--- loncom/homework/grades.pm:1.160	Fri Nov 21 16:31:34 2003
+++ loncom/homework/grades.pm	Fri Nov 21 17:59:42 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.160 2003/11/21 21:31:34 albertel Exp $
+# $Id: grades.pm,v 1.161 2003/11/21 22:59:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3634,18 +3634,6 @@
     return 0;
 }
 
-#FIXME I think I am doing this in the wrong order, I think it would be
-#better to make a several passes analyzing all of the lines in the
-#file for common errors wrong/invalid PID/username duplicated
-#PID/username, missing bubbles, double bubbles, missing/invalid CODE
-#and then get the instructor to fix all of these errors, then grade
-#the corrected one, I'll still need to catch error conditions, but
-#maybe most will taken care even before we start
-
-sub scantron_validate_file {
-    my ($r) = @_;
-}
-
 sub scantron_process_corrections {
     my ($r) = @_;
     my %scantron_config=&get_scantron_config($ENV{'form.scantron_format'});
@@ -3755,10 +3743,6 @@
     my $lines;
     $lines=&Apache::lonnet::getfile('/uploaded/'.$cdom.'/'.$cname.'/'.
 		       'scantron_orig_'.$ENV{'form.scantron_selectfile'});
-    if ($lines eq '-1') {
-	#FIXME need to actually replicate file to course space
-	#FIXME when replicating strip CRLF to LF or CR to LF
-    }
     my %scanlines;
     $scanlines{'orig'}=[(split("\n",$lines,-1))];
     my $temp=$scanlines{'orig'};
@@ -3898,7 +3882,7 @@
 #to show both the current line and the previous one and allow skipping
 #the previous one or the current one
 
-    $r->print("<p>An error was detected ($error) ");
+    $r->print("<p><b>An error was detected ($error)</b>");
     if ( defined($$scan_record{'scantron.PaperID'}) ) {
 	$r->print(" for PaperID <tt>".
 		  $$scan_record{'scantron.PaperID'}."</tt> \n");
@@ -4075,7 +4059,6 @@
  	($uname,$udom)=('','');
  	$i++;
  	my $line=&scantron_get_line($scanlines,$i);
-#	$r->print('<pre>line is'.$line.'</pre>');
  	if ($line=~/^[\s\cz]*$/) { next; }
  	my $scan_record=&scantron_parse_scanline($line,$i,\%scantron_config,
  						 $scan_data);
@@ -4090,15 +4073,11 @@
  				'Student '.$uname.' has multiple sheets',2);
  	    next;
  	}
-#	$r->print('<pre>doing studnet'.$uname.'</pre>');
   	($uname,$udom)=split(/:/,$uname);
   	&Apache::lonnet::delenv('form.counter');
   	&Apache::lonnet::appenv(%$scan_record);
-#    &Apache::lonhomework::showhash(%ENV);
-#    $Apache::lonxml::debug=1;
-#	&Apache::lonxml::debug("line is $line");
-  	
-	    my $i=0;
+	
+	my $i=0;
 	foreach my $resource (@resources) {
 	    $i++;
 	    my $result=&Apache::lonnet::ssi($resource->src(),
@@ -4108,23 +4087,6 @@
 				  'grade_domain'  =>$udom,
 				  'grade_courseid'=>$ENV{'request.course.id'},
 				  'grade_symb'    =>$resource->symb()));
-#	    my %score=&Apache::lonnet::restore($resource->symb(),
-#					       $ENV{'request.course.id'},
-#					       $udom,$uname);
-#	    foreach my $part ($resource->{PARTS}) {
-#		if ($score{'resource.'.$part.'.solved'} =~ /^correct/) {
-#		    $studentcorrect++;
-#		    $totalcorrect++;
-#		} else {
-#		    $studentincorrect++;
-#		    $totalincorrect++;
-#		}
-#	    }
-#	    $r->print('<pre>'.
-#		      $resource->symb().'-'.
-#		      $resource->src().'-'.'</pre>result is'.$result);
-#	    &Apache::lonhomework::showhash(%score);
-	#    if ($i eq 3) {last;}
 	}
 	$completedstudents{$uname}={'line'=>$line};
     } continue {
@@ -4132,32 +4094,11 @@
 	&Apache::lonnet::delenv('scantron\.');
 	&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
 						 'last student');
-	#last;
-	#FIXME
-	#get iterator for $sequence
-	#foreach question 'submit' the students answer to the server
-	#   through grade target {
-	#   generate data to pass back that includes grade recevied
-	#}
     }
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
     my $lasttime = &Time::HiRes::time()-$start;
     $r->print("<p>took $lasttime</p>");
 
-    #$Apache::lonxml::debug=0;
-    foreach my $delay (@delayqueue) {
-	#FIXME
-	#print out each delayed student with interface to select how
-	#  to repair student provided info
-	#Expected errors include
-	#  1 bad/no stuid/username
-	#  2 invalid bubblings
-	
-    }
-    #FIXME
-    # if delay queue exists 2 submits one to process delayed students one
-    #     to ignore delayed students, possibly saving the delay queue for later
-    
     $navmap->untieHashes();
     $r->print("<p>Done</p>");
     $r->print(&show_grading_menu_form($symb,$url));