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

Annotation of /trunk/webwork/system/scripts/recoverDataSet.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1533 - (view) (download) (as text)

1 : sh002i 1533 #!/usr/bin/env perl
2 : sam 2
3 :     ## $Id$
4 :    
5 : sam 70 BEGIN {
6 :     my $useLibDir = '.';
7 :     if ($0 =~ m|^(/.*)/|) { $useLibDir = $1; }
8 :     elsif ($0 =~ m|^(\..*)/|) { $useLibDir = $1; }
9 :     elsif ($0 =~ m|^(.+)/|) { $useLibDir = "./$1"; }
10 :     unshift @INC, $useLibDir;
11 :     }
12 :    
13 :     use webworkInit; # WeBWorKInitLine
14 : sam 2 use Global;
15 :    
16 :     # This file is recoverDataSet.pl
17 :    
18 :     ## Takes two command line arguments. The first is the course name. The second
19 :     ## command line argument the filename with or without the extension of the bak data file,
20 :     ## e.g. s5bak3. Produces new versions of the corresponding ful and scr files,
21 :     ## e.g. s5ful and s5scr.
22 :    
23 :     if (@ARGV != 2)
24 :     {print "\nSyntax is recoverDataSet.pl courseID backUpFile \n";
25 :     print "File names are entered with or without the extension, e.g. enter s7bak3 or s7bak3.csv \n";
26 :     print " (e.g. recoverDataSet.pl MTH140A s7bak3 ) \n\n";
27 :     exit(0);
28 :     }
29 :    
30 :    
31 :     #require "webwork.ph";
32 :     #require "${scriptDirectory}$DBglue_pl";
33 :     #require "${scriptDirectory}$SCRtools_pl";
34 :     #require "${scriptDirectory}FILE.pl";
35 :    
36 :    
37 :     local($courseID,$fileName1)=@ARGV;
38 :    
39 :     $scriptDirectory = $Global::scriptDirectory;
40 :     &Global::getCourseEnvironment($courseID);
41 :    
42 :     require "${scriptDirectory}$Global::DBglue_pl";
43 :     require "${scriptDirectory}$Global::FILE_pl";
44 :     require "${scriptDirectory}$Global::SCRtools_pl";
45 :    
46 :     $fileName1 =~ s/\.$Global::dat$//; ## remove dat extension if present
47 :    
48 :     &recover($fileName1);

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9