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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (download) (as text) (annotate)
Mon Jun 18 15:21:51 2001 UTC (12 years ago) by sam
File size: 1454 byte(s)
another setup script test (changed #! lines)

    1 #!/usr/local/bin/webwork-perl
    2 
    3 ## $Id$
    4 
    5 use lib '.'; use webworkInit; # WeBWorKInitLine
    6 use Global;
    7 
    8 
    9 # This file is deleteLastColumns.pl
   10 
   11 
   12         ## Takes three command line arguments.
   13   ## The first is the course name.
   14   ## The second is the filename  (without the extension),
   15         ## the third is the number of columns to delete,
   16   ## e.g. deleteLastColumns.pl className  s5ful 20   or  deleteLastColumns.pl className  s5scr 10.
   17         ## Note that "ful" files contain 2 columns for each problem (a `#corr' and an `#incorr'
   18         ## column) where as "scr" files contain 1 column for each problem (a `score' column).
   19 
   20 
   21 #require "webwork.ph";
   22 #require "${scriptDirectory}$DBglue_pl";
   23 #require "${scriptDirectory}$SCRtools_pl";
   24 #require "${scriptDirectory}FILE.pl";
   25 
   26 if (@ARGV != 3)
   27   {print "\nSyntax is deleteLastColumns.pl courseID dataSetFile numberOfColumns \n";
   28    print "File names are entered with orwithout the extension, e.g. enter s7scr or s7scr.csv \n";
   29    print "      (e.g. deleteLastColumns.pl MTH140A s7scr 10 ) \n\n";
   30    exit(0);
   31   }
   32 
   33 local($courseID, $fileName1,$num1)=@ARGV;
   34 
   35 $scriptDirectory   = $Global::scriptDirectory;
   36 &Global::getCourseEnvironment($courseID);
   37 
   38 require "${scriptDirectory}$Global::DBglue_pl";
   39 require "${scriptDirectory}$Global::FILE_pl";
   40 require "${scriptDirectory}$Global::SCRtools_pl";
   41 
   42 $fileName1 =~ s/\.$Global::dat$//;  ## remove dat extension if present
   43 
   44 &delete_columns ($fileName1,-$num1,-1,1);

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9