示例#1
0
        private FileManipulation(FormMain globalFormMain)
        {
            _globalFormMain = globalFormMain;

            CreateMainFolderAndPathsExeLocation();

            MoveOldStroopVersion();

            CreateSubFolders(_reactionTestFilesPath);
            CreateSubFolders(_stroopTestFilesPath);
            CreateSubFolders(_experimentTestFilesPath);
            CreateSubFolders(_matchingTestFilesPath);

            CreateFolder(_listFolderName);
            CreateFolder(_participantDataPath);

            CreateBackupFolders();

            if (Directory.Exists(_defaultPath + "/StroopTestFiles"))
            {
                Directory.Delete(_defaultPath + "/StroopTestFiles", true);
            }

            // converting old implementations of file lists to new version
            StrList.convertFileLists();

            // create default stroop and reaction programs, adding default word and color lists
            InitializeDefaultPrograms();
        }
示例#2
0
 public void setAudioListFile(string listName)
 {
     if (listName != "false")
     {
         audioListFile = new StrList(listName, 1);
     }
     else
     {
         audioListFile = null;
     }
 }
示例#3
0
 public void setImageListFile(string listName)
 {
     if (listName != "false")
     {
         imagesListFile = new StrList(listName, 0);
     }
     else
     {
         imagesListFile = null;
     }
 }
示例#4
0
 public void setColorListFile(string listName)
 {
     if (listName != "false")
     {
         colorsListFile = new StrList(listName, 3);
     }
     else
     {
         colorsListFile = null;
     }
 }
示例#5
0
 // creates word list object in case program has one
 public void setWordListFile(string listName)
 {
     if (listName != "false")
     {
         wordsListFile = new StrList(listName, 2);
     }
     else
     {
         wordsListFile = null;
     }
 }
示例#6
0
 private static void convertingList(string[] lists)
 {
     foreach (string list in lists)
     {
         string[]      name    = Path.GetFileNameWithoutExtension(list).Split('_');
         List <string> content = readListFile(list).ToList();
         StrList       newList = new StrList(content, name[0], "_" + name[1]);
         newList.saveContent(true);
         File.Delete(list);
     }
 }
示例#7
0
        /// <summary>
        /// Create default programs of tests, examples of tests configurations that can be run without needing any modification
        /// Currently, there are stroop program, reaction program, color list and word list.
        /// </summary>
        private void InitializeDefaultPrograms()
        {
            StroopProgram programDefault = new StroopProgram();

            programDefault.writeDefaultProgramFile(_stroopTestFilesPath + _programFolderName);

            ReactionProgram defaultProgram = new ReactionProgram();

            defaultProgram.writeDefaultProgramFile();

            StrList.writeDefaultWordsList(_listFolderName);
            StrList.writeDefaultColorsList(_listFolderName);
        }
示例#8
0
        private FileManipulation(string path)
        {
            _globalFormMain = null;

            CreateMainFolderAndPaths(path);

            MoveOldStroopVersion();

            CreateSubFolders(_reactionTestFilesPath);
            CreateSubFolders(_stroopTestFilesPath);
            CreateSubFolders(_experimentTestFilesPath);
            CreateSubFolders(_matchingTestFilesPath);

            /* creating Lists folder*/

            CreateFolder(_listFolderName);
            CreateFolder(_participantDataPath);
            // converting old implementations of file lists to new version
            StrList.convertFileLists();

            // create default stroop and reaction programs, adding default word and color lists
            InitializeDefaultPrograms();
        }