Diff for /loncom/homework/grades.pm between versions 1.83 and 1.85

version 1.83, 2003/04/04 23:35:17 version 1.85, 2003/04/19 09:02:57
Line 717  sub sub_page_kw_js { Line 717  sub sub_page_kw_js {
  height = 600;   height = 600;
  scrollbar = "yes";   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 = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx=70,screeny=75,width=600,height='+height);
     pWin.focus();      pWin.focus();
     pDoc = pWin.document;      pDoc = pWin.document;
Line 752  sub sub_page_kw_js { Line 752  sub sub_page_kw_js {
     pDoc.write("     includemsg = 1;");      pDoc.write("     includemsg = 1;");
     pDoc.write("  }");      pDoc.write("  }");
     pDoc.write("  imgformname = eval(\\"opener.document.SCORE.mailicon\\"+usrctr);");      pDoc.write("  imgformname = eval(\\"opener.document.SCORE.mailicon\\"+usrctr);");
     pDoc.write("  if (includemsg) {");      pDoc.write("  imgformname.src = \\"$iconpath/\\"+((includemsg) ? \\"mailto.gif\\" : \\"mailbkgrd.gif\\");");
     pDoc.write("     imgformname.src = \\"$iconpath/mailto.gif\\";");  
     pDoc.write("  } else {");  
     pDoc.write("     imgformname.src = \\"$iconpath/mailbkgrd.gif\\";");  
     pDoc.write("  }");  
     pDoc.write("  var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);");      pDoc.write("  var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);");
     pDoc.write("  includemsg.value = msgchk;");      pDoc.write("  includemsg.value = msgchk;");
   
Line 1250  KEYWORDS Line 1246  KEYWORDS
  my $lastone = pop @col_fullnames;   my $lastone = pop @col_fullnames;
  $msgfor .= ', '.(join ', ',@col_fullnames).' and '.$lastone.'.';   $msgfor .= ', '.(join ', ',@col_fullnames).' and '.$lastone.'.';
     }      }
       $msgfor =~ s/\'/\\'/g;
     $result.='<tr><td bgcolor="#ffffff">'."\n".      $result.='<tr><td bgcolor="#ffffff">'."\n".
  '&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.   '&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.
  ',\''.$msgfor.'\')"; TARGET=_self>'.   ',\''.$msgfor.'\')"; TARGET=_self>'.
Line 2985  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 2999  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 3010  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 3024  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 3039  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 3051  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 -------
 #  #

Removed from v.1.83  
changed lines
  Added in v.1.85


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>