--- loncom/homework/grades.pm 2003/04/04 23:35:17 1.83 +++ loncom/homework/grades.pm 2003/04/19 09:02:57 1.85 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.83 2003/04/04 23:35:17 albertel Exp $ +# $Id: grades.pm,v 1.85 2003/04/19 09:02:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -717,7 +717,7 @@ sub sub_page_kw_js { height = 600; scrollbar = "yes"; } -// if (window.pWin) window.pWin.close(); +// if (window.pWin) {window.pWin.close(); window.pWin=null} pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx=70,screeny=75,width=600,height='+height); pWin.focus(); pDoc = pWin.document; @@ -752,11 +752,7 @@ sub sub_page_kw_js { pDoc.write(" includemsg = 1;"); pDoc.write(" }"); pDoc.write(" imgformname = eval(\\"opener.document.SCORE.mailicon\\"+usrctr);"); - pDoc.write(" if (includemsg) {"); - pDoc.write(" imgformname.src = \\"$iconpath/mailto.gif\\";"); - pDoc.write(" } else {"); - pDoc.write(" imgformname.src = \\"$iconpath/mailbkgrd.gif\\";"); - pDoc.write(" }"); + pDoc.write(" imgformname.src = \\"$iconpath/\\"+((includemsg) ? \\"mailto.gif\\" : \\"mailbkgrd.gif\\");"); pDoc.write(" var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);"); pDoc.write(" includemsg.value = msgchk;"); @@ -1250,6 +1246,7 @@ KEYWORDS my $lastone = pop @col_fullnames; $msgfor .= ', '.(join ', ',@col_fullnames).' and '.$lastone.'.'; } + $msgfor =~ s/\'/\\'/g; $result.='
doing studnet'.$uname.''); ($uname,$udom)=split(/:/,$uname); - &Apache::lonnet::delenv('form\.counter$'); #') stupid emacs + &Apache::lonnet::delenv('form.counter'); &Apache::lonnet::appenv(%$scan_record); +# &Apache::lonhomework::showhash(%ENV); $Apache::lonxml::debug=1; - &Apache::lonhomework::showhash(%ENV); - $Apache::lonxml::debug=0; + &Apache::lonxml::debug("line is $line"); + my $i=0; foreach my $resource (@resources) { + $i++; my $result=&Apache::lonnet::ssi($resource->src(), ('submitted' =>'scantron', 'grade_target' =>'grade', @@ -3024,13 +3031,30 @@ SCANTRONFORM '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('
'. $resource->symb().'-'. $resource->src().'-'.'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::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; #FIXME #get iterator for $sequence @@ -3039,6 +3063,7 @@ SCANTRONFORM # generate data to pass back that includes grade recevied #} } + $Apache::lonxml::debug=0; foreach my $delay (@delayqueue) { #FIXME #print out each delayed student with interface to select how @@ -3051,7 +3076,8 @@ SCANTRONFORM #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(); } #-------- end of section for handling grading scantron forms ------- #