[system] / trunk / webwork / system / scripts / pScSet6.pl Repository:
ViewVC logotype

View of /trunk/webwork/system/scripts/pScSet6.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1252 - (download) (as text) (annotate)
Mon Jun 23 18:28:59 2003 UTC (16 years, 7 months ago) by apizer
File size: 36337 byte(s)
Add Enrollment Status to scoring files

Arnie

    1 #!/usr/local/bin/webwork-perl
    2 
    3 ## $Id$
    4 
    5 ####################################################################
    6 # Copyright @ 1995-1998 University of Rochester
    7 # All Rights Reserved
    8 ####################################################################
    9 
   10 
   11 use strict;
   12 # This file is pScSet6.pl
   13 #
   14 
   15 # For these scoring subroutines to work, the calling script must require
   16 # the following files, i.e. it must contain the lines:
   17 # require "webwork.ph";
   18 # require "${scriptDirectory}$DBglue_pl";
   19 # require "${scriptDirectory}$Global::classlist_DBglue_pl";
   20 # require "${scriptDirectory}FILE.pl";
   21 
   22 my $debugOn=0;
   23 
   24 # Things defined in Global.pl (can be over ridden by statements in webworkCourse.ph)
   25 
   26 my $scoringDirectory  = &getCourseScoringDirectory();
   27 my $databaseDirectory = getCourseDatabaseDirectory();
   28 my $DELIM = &getDelim();
   29 my $scoreFilePrefix = &getScoreFilePrefix();
   30 my $scoring_log = &getScoring_log();
   31 my $dash = &getDash();
   32 my $DAT = &getDat();
   33 my @DBEXT = &getBbext();
   34 my @STATUS_DROP = &getStatusDrop();
   35 my %sortaaArray = ();  ## declared here so that we can use it in the sort routines
   36 
   37 ##Global Definition of headerline names
   38 my @HL=("PIN","NO OF FIELDS","SET NUMBER","PROB NAME","DUE DATE","DUE TIME","PROB VALUE","STUDENT ID");
   39 
   40 
   41 # &scoreMessage("scoring dir is $scoringDirectory");
   42 
   43 
   44 sub scoreMessage {
   45 
   46   ## Prints message to scoring log and STDERR
   47   my ($string) = $_[0];
   48   unless (-e "${scoringDirectory}${scoring_log}") {
   49      &createFile("${scoringDirectory}${scoring_log}", $Global::scoring_files_permission, $Global::numericalGroupID);
   50   }
   51    open(LOGFILE, ">>${scoringDirectory}${scoring_log}")  or
   52     &wwerror("$0","Can't append to ${scoringDirectory}${scoring_log}");
   53   print LOGFILE "$string\n";
   54   print STDERR  "$string\n";
   55   close(LOGFILE);
   56 }
   57 
   58 sub get_raw_scores  {
   59 
   60   ## Called with parameters
   61   ## ($method, $setNumber, $dueDate, $dueTime, $problemListref, $problemValueListref)
   62   ## The $method is either 'db' (the default) or 'scofiles' which
   63   ## determined if the data will be read from the database or sco files
   64   ## The last two parameters are only used with the 'scofiles' scoring method.
   65   ## Before this subroutine is run, the set definition file must be read with readSetDefinition
   66 
   67   ## get the number of Y's and N's from database or sco files S{set#}-{pin#}.sco and
   68   ## store them in three files: (1) s{set#}bak{#}.${DAT} by rows:  pin# ,ss# , lastname
   69   ##, firstnames , #Y , #N , #Y , #N ... .  Here bak{#} is bak1, bak2, etc.  This file is
   70   ## never overwritten.  Everytime the set is scored, a new bak file is created.
   71   ## (2) s{set#}ful.${DAT} by rows:  ss# , lastname , firstnames , #Y ,
   72   ## #N , #Y , #N ...  (3) s{set#}scr.${DAT} by rows:  ss# , lastname , firstnames
   73   ## , [01] , [01] , ... where 1 indicates a correct answer and 0 otherwise.  Files
   74   ## (2) and (3) have header rows and are suitable for analyzing with a spreadsheet or
   75   ## database program.  Note: the delimiters, shown above as comas (","), are set by
   76   ## $DELIM e.g.  $DELIM=","
   77 
   78   my ($method, $setNumber, $dueDate, $dueTime, $problemListref, $problemValueListref) = @_;
   79   my ($noOfProbs,$pin,$num,$warnTag,$i,$string,$dataLine,$probValue);
   80   my(@bakArray,@fulArray,@scrArray,@Yarray,@Narray,@Sarray,@temp,@pinNumbersArray);
   81   my(%assocArray);
   82   my(@probList,@probVal,$bakFileName);
   83 
   84   @pinNumbersArray = &getAllProbSetKeysForSet($setNumber);
   85 
   86   if ($method eq 'scofiles') {
   87      @probList = @$problemListref;
   88       @probVal = @$problemValueListref;
   89   }
   90   else {
   91     $pin =$pinNumbersArray[0];
   92     &attachProbSetRecord($pin) or &wwerror("$0","no Record $pin");
   93     @probList = &getAllProblemsForProbSetRecord($pin);
   94     @probList = sort( { $a <=> $b }  @probList);
   95     @probVal = ();
   96     foreach $num (@probList) {
   97       $probValue = &getProblemValue($num,$pin);
   98       push @probVal, $probValue;
   99     }
  100   }
  101 
  102   $i=1;
  103   while(-e "${scoringDirectory}s${setNumber}bak$i.${DAT}") {$i++;}      ##don't overwrite existing backups
  104   $bakFileName ="${scoringDirectory}s${setNumber}bak$i.${DAT}";
  105 
  106   &createFile($bakFileName, 0660, $Global::numericalGroupID);
  107   open(RAWSCORES,">$bakFileName")  or &wwerror("$0","Can't open $bakFileName");
  108   &backup("s${setNumber}ful");            ## make upto three backups
  109 
  110   &createFile("${scoringDirectory}s${setNumber}ful.${DAT}", $Global::scoring_files_permission, $Global::numericalGroupID);
  111   open(FULLSCORES,">${scoringDirectory}s${setNumber}ful.${DAT}")  or
  112   &wwerror("$0","Can't open ${scoringDirectory}s${setNumber}ful.${DAT}");
  113   &backup("s${setNumber}scr");            ## make upto three backups
  114 
  115   &createFile("${scoringDirectory}s${setNumber}scr.${DAT}", $Global::scoring_files_permission, $Global::numericalGroupID);
  116   open(SCORES,">${scoringDirectory}s${setNumber}scr.${DAT}")   or
  117   &wwerror("$0","Can't open ${scoringDirectory}s${setNumber}scr.${DAT}");
  118   $noOfProbs=@probList;
  119   print "noOfProbs is $noOfProbs\n" if $debugOn;
  120   print "problems values are @probVal\n"  if $debugOn;
  121 
  122   &bak_dat_header($setNumber, $noOfProbs , $dueDate, $dueTime, \@probVal);
  123   &ful_dat_header($setNumber, $noOfProbs , $dueDate, $dueTime, \@probVal);
  124   &scr_dat_header($setNumber, $noOfProbs , $dueDate, $dueTime, \@probVal);
  125 
  126 
  127   foreach $pin (@pinNumbersArray) {
  128       attachProbSetRecord($pin);
  129       my $studentLogin = getStudentLogin($pin);
  130       attachCLRecord($studentLogin);
  131 
  132       #### initialize arrays
  133       @bakArray=($pin,&CL_getStudentID($studentLogin), &CL_getStudentLastName($studentLogin), &CL_getStudentFirstName($studentLogin),&CL_getClassSection($studentLogin),&CL_getClassRecitation($studentLogin),&CL_getStudentStatus($studentLogin));
  134       @fulArray=@bakArray;
  135      shift @fulArray;
  136       @scrArray=@fulArray;
  137 
  138       @Yarray=(0) x ($noOfProbs+1);           ##holds number of correct responses
  139       @Narray=(0) x ($noOfProbs+1);           ##holds number of incorrect responses
  140       @Sarray=(0) x ($noOfProbs+1);           ##holds scores
  141 
  142      if ($method eq 'scofiles') {
  143        ########  GET NUMBER OF CORRECT AND INCORRECT ANSWERS FROM SCO FILES #####
  144        my $Yarrayref = \@Yarray;
  145        my $Narrayref = \@Narray;
  146        my $Sarrayref = \@Sarray;
  147        &getRecordedScores($Sarrayref,$Yarrayref,$Narrayref,$pin);
  148     }
  149      else {
  150        ########  GET NUMBER OF CORRECT AND INCORRECT ANSWERS FROM DATABASE #####
  151        for ($i=1;$i<=$noOfProbs;$i++) {
  152          $Yarray[$i] = &getProblemNumOfCorrectAns($i,$pin);
  153          $Narray[$i] = &getProblemNumOfIncorrectAns($i,$pin);
  154         $Sarray[$i] = &getProblemStatus($i,$pin);
  155       }
  156     }
  157 
  158       $warnTag=0;
  159       for ($i=1;$i<=$noOfProbs;$i++) {
  160         if ($Yarray[$i] > 99) {
  161               $warnTag=1;
  162               $Yarray[$i] = 99
  163         }
  164         if ($Narray[$i] > 99) {
  165               $warnTag=1;
  166               $Narray[$i] = 99
  167         }
  168       }
  169       if ($warnTag == 1) {
  170         &scoreMessage("Warning: more than 99 attempts for a single problem in ${scoringDirectory}s${setNumber}ful.${DAT}");
  171       }
  172 
  173       for ($i=1;$i<=$noOfProbs;$i++)  {
  174         push(@bakArray,$Sarray[$i]);
  175         push(@bakArray,$Yarray[$i]);
  176         push(@bakArray,$Narray[$i]);
  177         push(@fulArray,$Sarray[$i]);
  178         push(@fulArray,$Yarray[$i]);
  179         push(@fulArray,$Narray[$i]);
  180         push(@scrArray,$Sarray[$i]);
  181       }
  182       $dataLine=join("${DELIM}",@bakArray);
  183       print "$dataLine\n" if $debugOn;
  184       print RAWSCORES "$dataLine\n";
  185       $dataLine=join("${DELIM}",@fulArray);
  186       print "$dataLine\n" if $debugOn;
  187       print FULLSCORES "$dataLine\n";
  188       $dataLine=join("${DELIM}",@scrArray);
  189       print "$dataLine\n" if $debugOn;
  190       print SCORES "$dataLine\n";
  191 
  192    }                                               ##end of $pin for each loop
  193    close(RAWSCORES);
  194    close(FULLSCORES);
  195    close(SCORES);
  196 
  197    ##permissions set here
  198 
  199    chmod($Global::scoring_bak_files_permission,$bakFileName)  or
  200     &wwerror("$0","Can't do chmod($Global::scoring_bak_files_permission,$bakFileName)");
  201    %assocArray = &dat2aa("s${setNumber}ful");
  202    &aa2dat(\%assocArray,"s${setNumber}ful","AbySec");                           ##alphbatize
  203 
  204    %assocArray = &dat2aa("s${setNumber}scr");
  205    &aa2dat(\%assocArray,"s${setNumber}scr","AbySec");                           ##alphbatize
  206 
  207 }
  208 
  209 
  210 
  211 
  212 sub ful_dat_header {
  213    ## add header lines to the set ful.${DAT} files
  214    my ($setNumber, $noOfProbs , $dueDate, $dueTime, $probValref) = @_;
  215    my $num =$noOfProbs;
  216    my @valArray = @$probValref;
  217 
  218    my ($i);
  219 
  220    $num=3*$num+6;          ## number of fields is 6 more than twice number of problems
  221    my @array = ();
  222    my $dataLine ='';
  223 
  224   ## first header line
  225    @array=(" ") x $num;
  226    $array[0]=$HL[1];
  227    $dataLine=join("${DELIM}",@array);
  228    print FULLSCORES "$dataLine\n";
  229 
  230   ## second header line   set number
  231    @array=(" ") x $num;
  232    $array[0]=$HL[2];
  233    for ($i=6; $i < $num; $i=$i+3) {$array[$i]=$setNumber;}
  234    $dataLine=join("${DELIM}",@array);
  235    print FULLSCORES "$dataLine\n";
  236 
  237   ## third header line    problem numbers
  238    @array=(" ") x $num;
  239    $array[0]=$HL[3];
  240    for ($i=6; $i < $num; $i=$i+3) {$array[$i]=int(($i-3)/3);$array[$i+1]=int(($i-3)/3);$array[$i+2]=int(($i-3)/3);}
  241    $dataLine=join("${DELIM}",@array);
  242    print FULLSCORES "$dataLine\n";
  243 
  244   ## fourth header line
  245    @array=(" ") x $num;
  246    $array[0]=$HL[4];
  247    for ($i=6; $i < $num; $i=$i+3) {$array[$i]=$dueDate;}
  248    $dataLine=join("${DELIM}",@array);
  249    print FULLSCORES "$dataLine\n";
  250 
  251   ## fifth header line
  252    @array=(" ") x $num;
  253    $array[0]=$HL[5];
  254    for ($i=6; $i < $num; $i=$i+3) {$array[$i]=$dueTime;}
  255    $dataLine=join("${DELIM}",@array);
  256    print FULLSCORES "$dataLine\n";
  257 
  258   ## sixth header line
  259    @array=(" ") x $num;
  260    $array[0]=$HL[6];
  261    for ($i=6; $i < $num; $i=$i+3) {$array[$i]=shift(@valArray);}
  262    $dataLine=join("${DELIM}",@array);
  263    print FULLSCORES "$dataLine\n";
  264 
  265   ## seventh header line
  266    @array=(" ") x $num;
  267    $array[0]=$HL[7];
  268    $array[1]='LAST NAME';
  269    $array[2]='FIRST NAMES';
  270    $array[3]='SECTION';
  271    $array[4]='RECITATION';
  272    $array[5]='ENROLL STATUS';
  273   for ($i=6; $i < $num; $i=$i+3) {
  274      $array[$i]='PART CORR';
  275     $array[$i+1]='#corr';
  276     $array[$i+2]='#incorr';
  277    }
  278    $dataLine=join("${DELIM}",@array);
  279    print FULLSCORES "$dataLine\n";
  280 
  281 }
  282 
  283 
  284 
  285 
  286 sub bak_dat_header  {
  287    ## add header lines to the set bak.${DAT} files
  288    my ($setNumber, $noOfProbs , $dueDate, $dueTime, $probValref) = @_;
  289    my $num =$noOfProbs;
  290    my @valArray = @$probValref;
  291 
  292    my ($i);
  293 
  294    $num=3*$num+7;          ## number of fields is 7 more than twice number of problems
  295    my@array = ();
  296    my$dataLine = '';
  297 
  298   ## first header line
  299    @array=(" ") x $num;
  300    $array[0]="line1";
  301    $array[1]=$HL[1];
  302    $dataLine=join("${DELIM}",@array);
  303    print RAWSCORES "$dataLine\n";
  304 
  305   ## second header line
  306    @array=(" ") x $num;
  307    $array[0]="line2";
  308    $array[1]=$HL[2];
  309    for ($i=7; $i < $num; $i=$i+3) {$array[$i]=$setNumber;}
  310    $dataLine=join("${DELIM}",@array);
  311    print RAWSCORES "$dataLine\n";
  312 
  313   ## third header line
  314    @array=(" ") x $num;
  315    $array[0]="line3";
  316    $array[1]=$HL[3];
  317    for ($i=7; $i < $num; $i=$i+3) {$array[$i]=int(($i-4)/3);$array[$i+1]=int(($i-4)/3);$array[$i+2]=int(($i-4)/3);}
  318    $dataLine=join("${DELIM}",@array);
  319    print RAWSCORES "$dataLine\n";
  320 
  321   ## fourth header line
  322    @array=(" ") x $num;
  323    $array[0]="line4";
  324    $array[1]=$HL[4];
  325    for ($i=7; $i < $num; $i=$i+3) {$array[$i]=$dueDate;}
  326    $dataLine=join("${DELIM}",@array);
  327    print RAWSCORES "$dataLine\n";
  328 
  329   ## fifth header line
  330    @array=(" ") x $num;
  331    $array[0]="line5";
  332    $array[1]=$HL[5];
  333    for ($i=7; $i < $num; $i=$i+3) {$array[$i]=$dueTime;}
  334    $dataLine=join("${DELIM}",@array);
  335    print RAWSCORES "$dataLine\n";
  336 
  337   ## sixth header line
  338   @array=(" ") x $num;
  339   $array[0]="line6";
  340   $array[1]=$HL[6];
  341   for ($i=7; $i < $num; $i=$i+3) {$array[$i]=shift(@valArray);}
  342   $dataLine=join("${DELIM}",@array);
  343   print RAWSCORES "$dataLine\n";
  344 
  345   ## seventh header line
  346   @array=(" ") x $num;
  347   $array[0]="line7";
  348   $array[1]=$HL[7];
  349   $array[2]="LAST NAME";
  350   $array[3]="FIRST NAMES";
  351   $array[4]="SECTION";
  352   $array[5]="RECITATION";
  353   $array[6]="ENROLL STATUS";
  354    for ($i=7; $i < $num; $i=$i+3) {
  355       $array[$i]='PART CORR';
  356     $array[$i+1]="#corr";
  357     $array[$i+2]="#incorr";
  358    }
  359    $dataLine=join("${DELIM}",@array);
  360    print RAWSCORES "$dataLine\n";
  361 }
  362 
  363 
  364 
  365 
  366 sub scr_dat_header  {
  367    my ($setNumber, $noOfProbs , $dueDate, $dueTime, $probValref) = @_;
  368    my $num =$noOfProbs;
  369    my @valArray = @$probValref;
  370 
  371    my ($i);
  372 
  373    $num=$num+6;            ## number of fields is 5 more than number of problems
  374    my @array =();
  375    my $dataLine ='';
  376 
  377   ## first header line
  378    @array=(" ") x $num;
  379    $array[0]=$HL[1];
  380    $dataLine=join("${DELIM}",@array);
  381    print SCORES "$dataLine\n";
  382 
  383   ## second header line
  384    @array=(" ") x $num;
  385    $array[0]=$HL[2];
  386    for ($i=6; $i < $num; $i++) {$array[$i]=$setNumber;}
  387    $dataLine=join("${DELIM}",@array);
  388    print SCORES "$dataLine\n";
  389 
  390   ## third header line
  391    @array=(" ") x $num;
  392    $array[0]=$HL[3];
  393    for ($i=6; $i < $num; $i++) {$array[$i]=$i-5;}
  394    $dataLine=join("${DELIM}",@array);
  395    print SCORES "$dataLine\n";
  396 
  397   ## fourth header line
  398    @array=(" ") x $num;
  399    $array[0]=$HL[4];
  400    for ($i=6; $i < $num; $i++) {$array[$i]=$dueDate;}
  401    $dataLine=join("${DELIM}",@array);
  402    print SCORES "$dataLine\n";
  403 
  404   ## fifth header line
  405    @array=(" ") x $num;
  406    $array[0]=$HL[5];
  407    for ($i=6; $i < $num; $i++) {$array[$i]=$dueTime;}
  408    $dataLine=join("${DELIM}",@array);
  409    print SCORES "$dataLine\n";
  410 
  411   ## sixth header line
  412    @array=(" ") x $num;
  413    $array[0]=$HL[6];
  414    for ($i=6; $i < $num; $i++) {$array[$i]=shift(@valArray);}
  415    $dataLine=join("${DELIM}",@array);
  416    print SCORES "$dataLine\n";
  417 
  418   ## seventh header line
  419    @array=(" ") x $num;
  420    $array[0]=$HL[7];
  421    $array[1]="LAST NAME";
  422    $array[2]="FIRST NAMES";
  423    $array[3]="SECTION";
  424    $array[4]="RECITATION";
  425    $array[5]="ENROLL STATUS";
  426   for ($i=6; $i < $num; $i++) {$array[$i]="PART CORR";}
  427    $dataLine=join("${DELIM}",@array);
  428    print SCORES "$dataLine\n";
  429 
  430 }
  431 
  432 
  433 
  434 sub backup  {
  435   ## takes as a parameter the filename without the extension, e.g. ("s5ful") or ("s5scr")
  436   ## makes upto three backups of file with x, y, or z appended to filename where x
  437   ## the most recent backup
  438 
  439    my $fileName =$_[0];
  440    if (-e "${scoringDirectory}${fileName}y.${DAT}") {
  441       rename("${scoringDirectory}${fileName}y.${DAT}","${scoringDirectory}${fileName}z.${DAT}") or
  442       &wwerror("$0","can't rename ${scoringDirectory}${fileName}y.${DAT}");
  443    }
  444 
  445    if (-e "${scoringDirectory}${fileName}x.${DAT}") {
  446       rename("${scoringDirectory}${fileName}x.${DAT}","${scoringDirectory}${fileName}y.${DAT}") or
  447       &wwerror("$0","can't rename ${scoringDirectory}${fileName}x.${DAT}");
  448    }
  449 
  450   if (-e "${scoringDirectory}${fileName}.${DAT}") {
  451       rename("${scoringDirectory}${fileName}.${DAT}","${scoringDirectory}${fileName}x.${DAT}") or
  452       &wwerror("$0","can't rename ${scoringDirectory}${fileName}.${DAT}");
  453    }
  454 }
  455 
  456 sub dat2aa  {
  457    ## takes as a parameter the filename without the extension, e.g. ("s5ful") or ("s5scr")
  458    my $fileName =$_[0];
  459    my(%aaArray);
  460 
  461    &checkdat("$fileName");
  462    print "dat2aa working on ${scoringDirectory}${fileName}.${DAT}\n" if $debugOn;
  463    %aaArray = &delim2aa("${scoringDirectory}${fileName}.${DAT}");
  464 }
  465 
  466 
  467 
  468 sub aa2dat {
  469 
  470   ## Saves an associative array version of the scoring files as a delimited file.
  471    ## Takes three parameters.  The first is the name of an associative array
  472   ## passed by reference. The second is a filename without the extension,
  473    ## e.g. s5ful or s5scr.  The third optional parameter determined the
  474    ## sorting order.  The default will be to sort alpabetically first by section,
  475   ## then by student name. If the third parameter is 'A', the
  476    ## sort order will be alpabetically by student name.  If the third parameter is 'SbySec',
  477   ## the sort order will be first by section, then by studentID. If the third parameter
  478   ## is 'S', the sort order will be by studentID.
  479   ## Creates a $filename.$DAT file which is an text version of the associative array
  480   ## E.g., &aa2delim(\%aaArray, s1scr, A)
  481 
  482    my($aaArrayref,$fileName,$sortorder)=@_;
  483    %sortaaArray = %$aaArrayref;
  484    print "aa2delim working on ${scoringDirectory}${fileName}.${DAT}\n" if $debugOn;
  485 
  486    my(@sortedkeys,@keys,@hdrarray,%mark,$dbString,$studID);
  487    unless (defined $sortorder) {$sortorder = 'AbySec';}
  488 
  489   unless(-e "${scoringDirectory}${fileName}.${DAT}") {
  490      &createFile("${scoringDirectory}${fileName}.${DAT}", $Global::scoring_files_permission, $Global::numericalGroupID);
  491   }
  492    open(DATFILE,">${scoringDirectory}${fileName}.${DAT}") or
  493     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  494    @hdrarray=@HL;                          ##get header line labels
  495    shift(@hdrarray);                       ##put first header line label in 0th position
  496    foreach $studID (@hdrarray)   {            ##put header lines in ${DAT} file
  497       $dbString=$sortaaArray{$studID};
  498       $dbString="$studID${DELIM}$dbString";
  499       print DATFILE "$dbString\n";
  500    }
  501    if ($sortorder eq "S") {@sortedkeys = sort by_studentID (keys(%sortaaArray));}
  502   elsif ($sortorder eq "SbySec") {@sortedkeys = sort by_section_then_by_studentID (keys(%sortaaArray));}
  503   elsif ($sortorder eq "A") {@sortedkeys = sort by_studentName (keys(%sortaaArray));}
  504   elsif ($sortorder eq "SbyRec") {@sortedkeys = sort by_recitation_then_by_studentID (keys(%sortaaArray));}
  505   elsif ($sortorder eq "AbyRec") {@sortedkeys = sort by_recitation_then_by_studentName (keys(%sortaaArray));}
  506   else {@sortedkeys = sort by_section_then_by_studentName (keys(%sortaaArray));}
  507 
  508    grep($mark{$_}++,@hdrarray);            ##remove header line keys from sortedkeys
  509    @keys=grep(!$mark{$_},@sortedkeys);
  510    foreach $studID (@keys) {
  511       $dbString=$sortaaArray{$studID};
  512       $dbString="$studID${DELIM}$dbString";
  513    print DATFILE "$dbString\n";
  514    }
  515    close(DATFILE);
  516 
  517    &columnPrint ("${scoringDirectory}${fileName}.${DAT}","${scoringDirectory}${fileName}.${DAT}")
  518 }
  519 
  520 sub by_studentID {$a cmp $b;}                      ## sort by student ID
  521 
  522 sub by_section_then_by_studentID {                        ## sort by student ID
  523 
  524   (&get_section($a) cmp &get_section($b))
  525   or
  526   ($a cmp $b);
  527 }
  528 
  529 sub by_recitation_then_by_studentID {                        ## sort by student ID
  530 
  531   (&get_recitation($a) cmp &get_recitation($b))
  532   or
  533   ($a cmp $b);
  534 }
  535 
  536 
  537 sub by_studentName {
  538    ## sort by student name
  539    (lc(&get_last_name($a)) cmp lc(&get_last_name($b)))
  540   or
  541   (lc(&get_first_names($a)) cmp lc(&get_first_names($b)))
  542   or
  543   ($a cmp $b);
  544 }
  545 
  546 sub by_section_then_by_studentName {
  547    ## sort by student name
  548   (&get_section($a) cmp &get_section($b))
  549   or
  550    (lc(&get_last_name($a)) cmp lc(&get_last_name($b)))
  551   or
  552   (lc(&get_first_names($a)) cmp lc(&get_first_names($b)))
  553   or
  554   ($a cmp $b);
  555 }
  556 
  557 sub by_recitation_then_by_studentName {
  558    ## sort by student name
  559   (&get_recitation($a) cmp &get_recitation($b))
  560   or
  561    (lc(&get_last_name($a)) cmp lc(&get_last_name($b)))
  562   or
  563   (lc(&get_first_names($a)) cmp lc(&get_first_names($b)))
  564   or
  565   ($a cmp $b);
  566 }
  567 
  568 sub get_last_name {
  569   my ($studID) =@_;
  570   my @temp=split(/${DELIM}/,$sortaaArray{$studID});
  571   return $temp[0] if defined $temp[0];
  572   '';
  573 }
  574 sub get_first_names {
  575    my ($studID) =@_;
  576    my @temp=split(/${DELIM}/,$sortaaArray{$studID});
  577   return $temp[1] if defined $temp[1];
  578   '';
  579 }
  580 sub get_section {
  581    my ($studID) =@_;
  582    my @temp=split(/${DELIM}/,$sortaaArray{$studID});
  583   return $temp[2] if defined $temp[2];
  584   '';
  585 }
  586 
  587 sub get_recitation {
  588    my ($studID) =@_;
  589    my @temp=split(/${DELIM}/,$sortaaArray{$studID});
  590   return $temp[3] if defined $temp[3];
  591   '';
  592 }
  593 
  594 sub append_score_db {
  595   ## Takes two parameters. The first is the filename (without the extension)
  596    ## of the cummulative database. The second  is the filename (without the
  597    ## extension) of the database to be appended. E.g.  append_score_db ("dbfile", "appenddbfile")
  598 
  599    my ($dbFile,$appenddbFile)=@_;
  600    my ($studID,$temp,$i,$dbNoOfFields,$appenddbNoOfFields,$dbString,$string);
  601    my (@dbArray,@temp,@temp1,%appenddbaArray);
  602    my (%dbaArray);
  603   %dbaArray = &dat2aa("$dbFile");
  604    my $cumm_db_non_empty =  scalar(%dbaArray); ## this will be 0 if empty
  605    %appenddbaArray = &dat2aa("$appenddbFile");
  606 
  607    if ($cumm_db_non_empty) {
  608       $_=$dbaArray{"NO OF FIELDS"};
  609       $temp=s/${DELIM}/${DELIM}/g;            ##find number of delims in  string
  610    }
  611    else {$temp =0};
  612    $dbNoOfFields=$temp+2;                  ##num of fields in dat file
  613    $_=$appenddbaArray{"NO OF FIELDS"};
  614    $temp=s/${DELIM}/${DELIM}/g;            ##find number of delims in  string
  615    $appenddbNoOfFields=$temp+2;
  616    foreach $studID (keys %dbaArray) {
  617     if ( not defined ($appenddbaArray{$studID})) {  ##handle case where record is not in
  618       ##appended database
  619         $dbString=$dbaArray{$studID};
  620         @dbArray=&getRecord($dbString);
  621         &scoreMessage("No record for $dbArray[1] $dbArray[0] , ID = $studID,\n in the $appenddbFile database.  The record will be padded with blanks.");
  622         $temp=" ${DELIM}" x ($appenddbNoOfFields-6);     ##blanks for fields
  623         $dbString.=$temp;
  624         $dbaArray{$studID}=$dbString;
  625 
  626       }
  627       else {
  628         $dbString=$appenddbaArray{$studID};
  629         $dbString=~s/^[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*//;
  630           ##remove last and first names and section and 8/16/00 recitation and 6/23/03 status
  631         $dbaArray{$studID}.=$dbString;
  632       }
  633    }
  634                               ##end of foreach
  635 
  636    foreach $studID (keys (%appenddbaArray)) {          ##handle case where record is not in
  637                             ##cummulative database
  638     unless (defined ($dbaArray{$studID})) {
  639       $dbString=$appenddbaArray{$studID};
  640       @dbArray=&getRecord($dbString);
  641         &scoreMessage("No record for $dbArray[1] $dbArray[0] , ID = $studID,\n in the $dbFile database.  The record will be padded with blanks.") if $cumm_db_non_empty ;
  642         $temp=" ${DELIM}" x ($dbNoOfFields-6);
  643         $dbString=~s/(^[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM}[^${DELIM}]*${DELIM})/${1}$temp/;
  644         $dbaArray{$studID}=$dbString;
  645       }                               ##end of unless
  646 
  647    }                                       ##end of foreach
  648 
  649   &backup("$dbFile");                             ##backup dat files
  650    &aa2dat(\%dbaArray,"$dbFile","AbySec");               ##update dat file
  651 }                                               ##end of sub append_score_db
  652 
  653 
  654 
  655 
  656 sub checkdat {
  657   ## takes as a parameter the filename without the extension, e.g. ("S5ful") or ("S5scr")
  658 
  659    my $fileName =$_[0];
  660    my $msg = htmlcheckdat($fileName);
  661    unless ($msg eq 'OK') {
  662       &wwerror("$0","$msg");
  663    }
  664 }
  665 
  666 sub htmlcheckdat {
  667   ## takes as a parameter the filename without the extension, e.g. ("S5ful") or ("S5scr")
  668    ## returns 'OK' or error message depending on whether dat file is valid or not
  669 
  670    my $fileName =$_[0];
  671    my ($noOfDelim,$firstLine,$dbString,$num,$temp,$i);
  672    my (@keyList, $msg);
  673 
  674    open(DATFILE,"${scoringDirectory}${fileName}.${DAT}") or
  675     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  676    $_= <DATFILE>;
  677    $firstLine=$_;
  678    if (defined $firstLine) {
  679       $noOfDelim=s/$DELIM/$DELIM/g;
  680       while (<DATFILE>) {
  681        $dbString=$_;
  682         $num=s/$DELIM/$DELIM/g;
  683         if ($num != $noOfDelim) {
  684            $msg = "${scoringDirectory}${fileName}.${DAT} is corrupted.\n The record\n  $firstLine\n
  685           contains $noOfDelim  delimiters ($DELIM) whereas the record\n
  686           $dbString  contains $num  delimiters.\n";
  687          return $msg;
  688        }
  689       }
  690    }
  691    close DATFILE;
  692    open(DATFILE,"${scoringDirectory}${fileName}.${DAT}") or
  693     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  694    @keyList=();
  695    while (<DATFILE>) {
  696     chomp;
  697     s/${DELIM}.*//;                         ## get key
  698     push(@keyList,$_);
  699    }
  700    close DATFILE;
  701    @keyList = sort(@keyList);
  702    for ($i=0; $i < @keyList-1; $i++) {
  703     if ($keyList[$i] eq $keyList[$i+1]) {
  704         $msg = "duplicate keys equal to $keyList[$i] in ${scoringDirectory}${fileName}.${DAT}";
  705         return $msg;
  706       }
  707    }
  708    $msg ='OK';
  709    return $msg;
  710 }
  711 
  712 
  713 
  714 sub recover  {
  715    ## takes as a parameter the filename without the extension of the bak data file,
  716    ## e.g. ("s5bak3").   Produces new versions of the corresponding ful and scr files,
  717    ## e.g. s5ful and s5scr.
  718    my $fileName =$_[0];
  719    my(@dbArray,$dbString,$fulFileName,$scrFileName,$temp,$noOfProbs,$noOfDelim,$i,$j,$ext);
  720   my (%assocArray);
  721    $temp=$fileName;
  722    $temp=~s\bak.*\\;
  723    $fulFileName="$temp"."ful";
  724    $scrFileName="$temp"."scr";
  725 
  726    &checkdat("$fileName");
  727 
  728   &backup("$fulFileName");
  729   &backup("$scrFileName");
  730 
  731 
  732    open(BAKFILE,"${scoringDirectory}${fileName}.${DAT}") or
  733     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  734    &createFile("${scoringDirectory}${fulFileName}.${DAT}", $Global::scoring_files_permission, $Global::numericalGroupID);
  735    open(FULLSCORES,">${scoringDirectory}${fulFileName}.${DAT}") or
  736     &wwerror("$0","can't open ${scoringDirectory}${fulFileName}.${DAT}");
  737    &createFile("${scoringDirectory}${scrFileName}.${DAT}", $Global::scoring_files_permission, $Global::numericalGroupID);
  738    open(SCORES,">${scoringDirectory}${scrFileName}.${DAT}") or
  739     &wwerror("$0","can't open ${scoringDirectory}${scrFileName}.${DAT}");
  740 
  741                         ##recover ful score file
  742    while (<BAKFILE>) {
  743     chomp;
  744       @dbArray=&getRecord($_);
  745       shift(@dbArray);
  746       $dbString=join("${DELIM}",@dbArray);
  747       print FULLSCORES "$dbString\n";
  748    }                       ## ful score file recovered
  749 
  750                            ## recover scr score file
  751 
  752   open(BAKFILE,"${scoringDirectory}${fileName}.${DAT}") or
  753     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  754    while (<BAKFILE>) {
  755     chomp;
  756       @dbArray=&getRecord($_);
  757       shift(@dbArray);            ## throw away first element
  758       my @outArray =();
  759       for ($j=1; $j <= 6; $j++) { ## put back next 6 elements
  760         push @outArray,shift(@dbArray);
  761       }
  762       while (@dbArray) {
  763         push @outArray,shift(@dbArray);     #save
  764         shift(@dbArray);        ## throw away
  765         shift(@dbArray);        ## throw away
  766       }
  767       $dbString=join($DELIM,@outArray);
  768       print SCORES "$dbString\n";
  769    }                       ## scr score file recovered
  770 
  771    close(BAKFILE);
  772    close(FULLSCORES);
  773    close(SCORES);
  774 
  775    %assocArray = &dat2aa("${fulFileName}");
  776    &aa2dat(\%assocArray,"${fulFileName}","AbySec");                           ##alphbatize
  777 
  778    %assocArray = &dat2aa("${scrFileName}");
  779    &aa2dat(\%assocArray,"${scrFileName}","AbySec");                           ##alphbatize
  780 }
  781 
  782 
  783 sub delete_columns {
  784    ## Takes four parameters. The first is the filename without the extension,
  785    ## the second is the first column of a range of columns to be deleted.
  786   ## the third is the last column of a range of columns to be deleted.
  787    ## the fourth is 1 for a prompt and 0 for none
  788   ## e.g. (s5ful,20,30,1) or (s5scr,10 15,0).
  789    ## Note that "ful" files contain 2 columns for each problem (a `#corr' and an `#incorr'
  790    ## column) where as "scr" files contain 1 column for each problem (a `score' column).
  791 
  792   ## the first column is 1 (not 0).  -2 refers to the second to last column, etc
  793 
  794    my ($fileName,$beginCol,$endCol,$prompt)=@_;
  795    my (@dbArray,@fileArray,$dbString,$studID,$temp,$temp1,$i,$tempFileName);
  796   my ($lastCol,$negBeginCol,$negEndCol);
  797 
  798     &checkdat("$fileName");
  799    open(DATFILE,"${scoringDirectory}${fileName}.${DAT}") or
  800     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  801    $_ = <DATFILE>;
  802    chomp;
  803    @dbArray=&getRecord($_);
  804   $lastCol = @dbArray;
  805   close(DATFILE);
  806   if ($beginCol =~ /^ *-/) {
  807     $negBeginCol = $beginCol;
  808     $beginCol = $lastCol + $beginCol +1;
  809   }
  810   else {$negBeginCol = $beginCol-$lastCol-1;}
  811 
  812   if ($endCol =~ /^ *-/) {
  813     $negEndCol = $endCol;
  814     $endCol = $lastCol + $endCol +1;
  815   }
  816   else {$negEndCol = $endCol-$lastCol-1;}
  817 
  818   if ($prompt) {
  819       print "\n\nThis procedure will remove a range of columns from the ${scoringDirectory}${fileName}.${DAT}\n";
  820       print "data set. That is a range of fields in each record in the ${fileName}.${DAT} data set will be removed.\n\n";
  821     print "The first column to be removed will be column $beginCol (i.e. column $negBeginCol).\n";
  822     print "The last column to be removed will be column $endCol (i.e. column $negEndCol).\n\n";
  823     print "Note that the first column is column 1 (i.e. column -$lastCol) and\n";
  824     print "the last column is column $lastCol (i.e. column -1).\n\n";
  825       print "Note also that \"ful\" data sets (e.g. \"s5ful\") contain 2 columns for each problem\n";
  826       print "(a `#corr' and an `#incorr' column) where as \"scr\" data sets (e.g. \"s5scr\") contain 1 column\n";
  827       print "for each problem (a `score' column).\n";
  828       print "DO YOU WANT TO CONTINUE WITH THIS OPERATION? (Y or N)\n";
  829       $temp=<STDIN>;
  830       chomp($temp);
  831       unless (($temp eq "Y") || ($temp eq "y")) {
  832         print "Operation aborted\n";
  833         exit;
  834       }
  835    }
  836   unless ((1 <= $beginCol) && ($beginCol <= $endCol) && ($endCol <= $lastCol)) {
  837      &wwerror("$0","Invalid Column Range.  Operation aborted\n
  838       beginCol =$beginCol   endCol = $endCol   lastCol = $lastCol\n");
  839       exit;
  840    }
  841   &backup("$fileName");
  842 
  843   ##copy backup file back to original file
  844 
  845   open(BACKFILE,"${scoringDirectory}${fileName}x.${DAT}")  or
  846     &wwerror("$0","can't open ${scoringDirectory}${fileName}x.${DAT}");
  847   @fileArray = <BACKFILE>;
  848   open(ORGFILE,">${scoringDirectory}${fileName}.${DAT}")  or
  849     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  850   print ORGFILE @fileArray;
  851   close(ORGFILE);
  852 
  853   ##find unique temp file name
  854   $i=1;
  855    $tempFileName = "${scoringDirectory}$fileName$i";
  856    while(-e "$tempFileName") {
  857       $i++;
  858       $tempFileName = "${scoringDirectory}$fileName$i";
  859    }
  860 
  861   open(TEMPFILE,">$tempFileName")  or
  862     &wwerror("$0","can't open $tempFileName");
  863    open(DATFILE,"${scoringDirectory}${fileName}.${DAT}")  or
  864     &wwerror("$0","can't open ${scoringDirectory}${fileName}.${DAT}");
  865    while (<DATFILE>) {
  866       chomp;
  867       @dbArray=&getRecord($_);
  868       splice(@dbArray,$beginCol-1,$endCol-$beginCol+1);
  869     $dbString=join("${DELIM}",@dbArray);
  870     print TEMPFILE "$dbString\n";
  871    }
  872 
  873    close(DATFILE);
  874   close(TEMPFILE);
  875   &columnPrint("$tempFileName","$tempFileName");
  876    rename("$tempFileName","${scoringDirectory}${fileName}.${DAT}") or
  877     &wwerror("$0","can't rename ${scoringDirectory}${fileName}.${DAT}");
  878   chmod($Global::scoring_files_permission, "${scoringDirectory}${fileName}.${DAT}") or
  879     &wwerror("$0","Can't do chmod($Global::scoring_files_permission, ${scoringDirectory}${fileName}.${DAT})");
  880    chown(-1,$Global::numericalGroupID,"${scoringDirectory}${fileName}.${DAT}") or
  881     &wwerror("$0","Can't do chown(-1,$Global::numericalGroupID,${scoringDirectory}${fileName}.${DAT})");
  882 }   ############  end of delete_columns;
  883 
  884 
  885 sub total_score  {
  886   ## Takes two parameters, the filename (without the extension) of the score
  887   ## database and a caption for the total column. E.g. ("s5scr", "set 5").
  888   ## Computes the total score by calculating the sum over
  889   ## columns 6,7,..., last column of round_score((prob value)*(prob scr)).
  890   ## That is value of each problem is rounded then added.  Note that col. 1
  891   ## is the student id, col.'s 2 and 3 hold the student last and first names,
  892   ## and columns 4 and holds the section and recitation and col 5 holds the status.
  893   ## The total is appended as a new col in the score database with a prob value of
  894   ## the maximum possible score (the sum of the prob values).
  895 
  896    my($dbFile,$caption) = @_;
  897 
  898   my (%assocArray);
  899    my($studID,$i,$dbNoOfDelim,$dbString,$total);
  900    my(@dbArray,@valArray);
  901 
  902 
  903   %assocArray =&dat2aa("$dbFile");                ## create assoc array
  904    &backup("$dbFile");                             ## backup dat file
  905    $_=$assocArray{"NO OF FIELDS"};
  906    $dbNoOfDelim=s/${DELIM}/${DELIM}/g;             ## find number of delims in  string
  907    $dbString=$assocArray{"PROB VALUE"};
  908   @valArray=&getRecord($dbString);          ## save prob values
  909 
  910   my $possible_total =0;
  911   for ($i=5; $i <= $dbNoOfDelim; $i++)  {$possible_total += $valArray[$i];}
  912 
  913    foreach $studID (keys %assocArray) {
  914     $dbString=$assocArray{$studID};
  915     @dbArray = &getRecord($dbString);
  916 
  917       if (($studID eq "NO OF FIELDS")  || ($studID eq "PROB NAME") || ($studID eq "DUE DATE")|| ($studID eq "DUE TIME")) {
  918       push (@dbArray, " ");
  919       }
  920       elsif  ($studID eq "SET NUMBER") {push (@dbArray,$caption);}   ## set set number to caption
  921       elsif ($studID eq "PROB VALUE") {push (@dbArray, $possible_total);}  ## set prob val to zero for total column
  922       elsif ($studID eq "STUDENT ID") {push (@dbArray, "total");}
  923       else {       ## handle actual data records and calculate total
  924       $total=0;
  925         for ($i=5; $i <= $dbNoOfDelim; $i++)  {$total += round_score($dbArray[$i]*$valArray[$i]);}
  926         push (@dbArray, $total);
  927       }                               ## end of if statement
  928       $dbString=join("${DELIM}",@dbArray);
  929       $assocArray{$studID}=$dbString;
  930    }                                       ## end of foreach $studID
  931   &aa2dat(\%assocArray,"${dbFile}","AbySec");           ##update dat file and alphbatize
  932 }                                               ##end of sub total_score
  933 
  934 
  935 
  936 
  937 sub test {
  938    ## Takes one parameter, the filename (without the extension) of the score
  939    ## database. E.g. ("s5scr").
  940    my($dbFile)=@_;
  941    my (%assocArray);
  942    %assocArray =&dat2aa("$dbFile");                ## create assoc array
  943    &backup("$dbFile");                             ## backup dat file
  944    &aa2dat(\%assocArray,"${dbFile}","AbySec");           ##update dat file and alphbatize
  945 }                                               ##end of test
  946 
  947 
  948 sub readProblemsAndValuesFromDB {
  949   my ($setNum,$studID,$cgiMode,$batchMode) = @_;
  950 
  951 #print "cgiMode is $cgiMode\n";
  952 #print "setNum is $setNum\n";
  953 #print "studID is $studID\n";
  954 #print "batchMode is $batchMode\n";
  955 
  956 
  957   my @keyList = &getAllProbSetKeysForSet($setNum);
  958   my (@problemList,@problemValues,@fixedProblemList,$fixedProblemValuesref,$num);
  959    unless ($studID) {$studID = $keyList[0];}  ##take a random studID if studID not defined
  960    &attachProbSetRecord($studID) || &wwerror("$0","no Record $studID");
  961    my $dueDate = &getDueDate($studID);
  962   my $fixedLogin_name = &getStudentLogin($studID);
  963   my ($problemListref,$problemValuesref) = getProblemsAndValues($studID);
  964   @fixedProblemList = @$problemListref;
  965   $fixedProblemValuesref = $problemValuesref;
  966   my $noOfProbs = @fixedProblemList;
  967   my $warningMsg = '';
  968 
  969   unless ($batchMode) {
  970     foreach $studID (@keyList) {
  971       ($problemListref,$problemValuesref) = getProblemsAndValues($studID);
  972        @problemList = @$problemListref;
  973        unless (($noOfProbs == @problemList) and (&arraysAreEqual($fixedProblemValuesref,$problemValuesref))) {
  974           my $login_name = &getStudentLogin($studID);
  975           my $warningMsg = "
  976 The values for problems (or the number of problems) are not the same for all students
  977 For example, the values for problems for loginID $fixedLogin_name are:
  978 @$fixedProblemValuesref
  979 whereas the values for problems for loginID $login_name are:
  980 @$problemValuesref
  981 You can Continue using the values for loginID $fixedLogin_name for all students or you can Quit";
  982 
  983          if ($cgiMode) {return($warningMsg, $dueDate, \@fixedProblemList, $fixedProblemValuesref); }
  984          else {
  985             print $warningMsg;
  986           print "\nEnter C or Q:[C]";
  987             my $ans;
  988               $ans=<STDIN>;
  989               chomp($ans);
  990               if (($ans eq "Q") || ($ans eq "q")) {exit 0;}
  991            }
  992         }
  993       }
  994   }
  995   ($warningMsg, $dueDate, \@fixedProblemList, $fixedProblemValuesref);
  996 }
  997 
  998 
  999 
 1000 sub getProblemsAndValues {
 1001   my ($studID) = @_;
 1002   &attachProbSetRecord($studID) || &wwerror("$0","no Record $studID");
 1003   my @problems = &getAllProblemsForProbSetRecord($studID);
 1004   my @problemList = sort( { $a <=> $b }  @problems);
 1005   my @problemValues = ();
 1006   my ($num, $problemListref, $problemValuesref);
 1007   foreach $num (@problemList) {push @problemValues, &getProblemValue($num,$studID)}
 1008   $problemListref = \@problemList;
 1009   $problemValuesref= \@problemValues;
 1010   ($problemListref, $problemValuesref);
 1011 }
 1012 
 1013 
 1014 sub arraysAreEqual {
 1015    my ($arrayOneref, $arrayTworef) = @_;
 1016   my $i;
 1017   unless ( @$arrayOneref == @$arrayTworef) { return 0 ;}
 1018   for ($i =0; $i < $#{@$arrayOneref}+1 ;$i++) {
 1019     unless ( $$arrayOneref[$i] == $$arrayTworef[$i]) { return 0 ;}
 1020    }
 1021   1;
 1022 }
 1023 
 1024 sub getRecordedScores {
 1025 
 1026    my ($Sarrayref,$Yarrayref,$Narrayref,$psvn) =  @_;
 1027    &attachProbSetRecord($psvn);
 1028    my $setNumber   =   &getSetNumber($psvn);
 1029    &detachProbSetRecord($psvn);
 1030       my ($scoreFileName)="${databaseDirectory}$scoreFilePrefix$setNumber$dash${psvn}.sco";
 1031       #print  "Reading from file $scoreFileName\n" if $debugON;
 1032       if ( open(SCORE_FILE,"<$scoreFileName")  )  {
 1033         while (<SCORE_FILE>)    {
 1034            my @temp=split(/$DELIM/,$_);
 1035            $$Sarrayref[$temp[0]] = $temp[1];
 1036            $$Yarrayref[$temp[0]] = $temp[2];
 1037            $$Narrayref[$temp[0]] = $temp[3];
 1038 
 1039         };
 1040         close(SCORE_FILE);
 1041       }   else {
 1042        warn "Warning: Couldn't open $scoreFileName.  Will continue.\n";
 1043       }
 1044     #  OPERATES ON THE ARRAYS Yarray and Narray.
 1045 }

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9