version 1.84, 2003/04/11 17:57:37
|
version 1.85, 2003/04/19 09:02:57
|
Line 2982 sub scantron_process_students {
|
Line 2982 sub scantron_process_students {
|
|
|
my %scantron_config=&get_scantron_config($ENV{'form.scantron_format'}); |
my %scantron_config=&get_scantron_config($ENV{'form.scantron_format'}); |
my $scanlines=Apache::File->new($Apache::lonnet::perlvar{'lonScansDir'}."/$ENV{'form.scantron_selectfile'}"); |
my $scanlines=Apache::File->new($Apache::lonnet::perlvar{'lonScansDir'}."/$ENV{'form.scantron_selectfile'}"); |
|
my @scanlines=<$scanlines>; |
my $classlist=&Apache::loncoursedata::get_classlist(); |
my $classlist=&Apache::loncoursedata::get_classlist(); |
my %idmap=&username_to_idmap($classlist); |
my %idmap=&username_to_idmap($classlist); |
my $navmap=Apache::lonnavmaps::navmap->new($ENV{'request.course.fn'}.'.db',$ENV{'request.course.fn'}.'_parms.db',1, 1); |
my $navmap=Apache::lonnavmaps::navmap->new($ENV{'request.course.fn'}.'.db',$ENV{'request.course.fn'}.'_parms.db',1, 1); |
Line 2996 SCANTRONFORM
|
Line 2997 SCANTRONFORM
|
$r->print($result); |
$r->print($result); |
|
|
my @delayqueue; |
my @delayqueue; |
|
my $totalcorrect; |
|
my $totalincorrect; |
|
|
|
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, |
|
'Scantron Status','Scantron Progress',scalar(@scanlines)); |
|
foreach my $line (@scanlines) { |
|
my $studentcorrect; |
|
my $studentincorrect; |
|
|
foreach my $line (<$scanlines>) { |
|
chomp($line); |
chomp($line); |
my $scan_record=&scantron_parse_scanline($line,\%scantron_config); |
my $scan_record=&scantron_parse_scanline($line,\%scantron_config); |
my ($uname,$udom); |
my ($uname,$udom); |
Line 3007 SCANTRONFORM
|
Line 3015 SCANTRONFORM
|
} |
} |
$r->print('<pre>doing studnet'.$uname.'</pre>'); |
$r->print('<pre>doing studnet'.$uname.'</pre>'); |
($uname,$udom)=split(/:/,$uname); |
($uname,$udom)=split(/:/,$uname); |
&Apache::lonnet::delenv('form\.counter$'); #') stupid emacs |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::appenv(%$scan_record); |
&Apache::lonnet::appenv(%$scan_record); |
|
# &Apache::lonhomework::showhash(%ENV); |
$Apache::lonxml::debug=1; |
$Apache::lonxml::debug=1; |
&Apache::lonhomework::showhash(%ENV); |
&Apache::lonxml::debug("line is $line"); |
$Apache::lonxml::debug=0; |
|
|
|
|
my $i=0; |
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |
|
$i++; |
my $result=&Apache::lonnet::ssi($resource->src(), |
my $result=&Apache::lonnet::ssi($resource->src(), |
('submitted' =>'scantron', |
('submitted' =>'scantron', |
'grade_target' =>'grade', |
'grade_target' =>'grade', |
Line 3021 SCANTRONFORM
|
Line 3031 SCANTRONFORM
|
'grade_domain' =>$udom, |
'grade_domain' =>$udom, |
'grade_courseid'=>$ENV{'request.course.id'}, |
'grade_courseid'=>$ENV{'request.course.id'}, |
'grade_symb' =>$resource->symb())); |
'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>'. |
$r->print('<pre>'. |
$resource->symb().'-'. |
$resource->symb().'-'. |
$resource->src().'-'.'</pre>result is'.$result); |
$resource->src().'-'.'</pre>result is'.$result); |
last; |
&Apache::lonhomework::showhash(%score); |
|
# if ($i eq 3) {last;} |
} |
} |
&Apache::lonnet::delenv('form\.counter$'); #') stupid emacs |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('scantron\.'); |
&Apache::lonnet::delenv('scantron\.'); |
|
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
|
'last student Who got a '.$studentcorrect.' correct and '. |
|
$studentincorrect.' incorrect. The class has gotten '. |
|
$totalcorrect.' correct and '.$totalincorrect.' incorrect'); |
last; |
last; |
#FIXME |
#FIXME |
#get iterator for $sequence |
#get iterator for $sequence |
Line 3036 SCANTRONFORM
|
Line 3063 SCANTRONFORM
|
# generate data to pass back that includes grade recevied |
# generate data to pass back that includes grade recevied |
#} |
#} |
} |
} |
|
$Apache::lonxml::debug=0; |
foreach my $delay (@delayqueue) { |
foreach my $delay (@delayqueue) { |
#FIXME |
#FIXME |
#print out each delayed student with interface to select how |
#print out each delayed student with interface to select how |
Line 3048 SCANTRONFORM
|
Line 3076 SCANTRONFORM
|
#FIXME |
#FIXME |
# if delay queue exists 2 submits one to process delayed students one |
# if delay queue exists 2 submits one to process delayed students one |
# to ignore delayed students, possibly saving the delay queue for later |
# to ignore delayed students, possibly saving the delay queue for later |
|
|
|
$navmap->untieHashes(); |
} |
} |
#-------- end of section for handling grading scantron forms ------- |
#-------- end of section for handling grading scantron forms ------- |
# |
# |