[LON-CAPA-cvs] cvs: modules /gerd/ct convert.pl

www lon-capa-cvs@mail.lon-capa.org
Thu, 01 Sep 2005 15:50:44 -0000


www		Thu Sep  1 11:50:44 2005 EDT

  Added files:                 
    /modules/gerd/ct	convert.pl 
  Log:
  Conversion script start
  
  

Index: modules/gerd/ct/convert.pl
+++ modules/gerd/ct/convert.pl
use strict;

my @ConceptTest;
my @CTStatus;
my @ImageType;
my @CTTimeStamp;
my @CopyrightTypes;
my @CTChoices;
my @Image;
my @ConceptTestType;
open(IN,'ct.sql');
while (my $line=<IN>) {
    if ($line=~/^INSERT INTO (\w+) VALUES \((\d+)\,(.*)\)\;$/) {
	if ($1 eq 'ConceptTest') {
            $ConceptTest[$2]=$3;
	} elsif ($1 eq 'CTStatus') {
	    $CTStatus[$2]=$3;
	} elsif ($1 eq 'ImageType') {
	    $ImageType[$2]=$3;
	} elsif ($1 eq 'CTTimeStamp') {
	    $CTTimeStamp[$2]=$3;
	} elsif ($1 eq 'CopyrightTypes') {
	    $CopyrightTypes[$2]=$3;
	}  elsif ($1 eq 'CTChoices') {
	    $CTChoices[$2]=$3;
	} elsif ($1 eq 'Image') {
	    $Image[$2]=$3;
	} elsif ($1 eq 'CTStatus') {
	    $ConceptTestType[$2]=$3;
	}
    }
}
close(IN);