Ejemplo n.º 1
0
        public override void Start(HumanSubject current_subject = null)
        {
            if (current_subject != null)
            {
                //Get the list of words to use for this study block
                var hal_config             = HumanAcceleratedLearningConfiguration.GetInstance();
                var available_dictionaries = hal_config.LanguageDictionaries;
                source_language_dictionary = available_dictionaries.Where(x =>
                                                                          x.ForeignLanguageName.Equals(ForeignLanguage) &&
                                                                          x.NativeLanguageName.Equals(NativeLanguage)
                                                                          ).FirstOrDefault();

                //Shuffle the words
                if (source_language_dictionary != null)
                {
                    var word_list = source_language_dictionary.DictionaryWordPairs.ToList();
                    shuffled_word_list     = MathHelperMethods.ShuffleList(word_list);
                    last_word_display_time = DateTime.MinValue;
                    current_wordpair_index = 0;

                    //Create a file for this study session
                    fid = StudyBlock.CreateStudyBlockFile(current_subject.UserName);

                    HasPhaseStarted = true;
                }
            }
        }
Ejemplo n.º 2
0
        public override void Start(HumanSubject current_subject = null)
        {
            if (current_subject != null)
            {
                _current_subject = current_subject;

                if (current_subject.AllObjectImages.Count == 0 && current_subject.AllObjectImageLocations.Count == 0)
                {
                    var res_folder = HumanAcceleratedLearningConfiguration.GetInstance().ResourcesFolder;
                    var img_path   = HumanAcceleratedLearningConfiguration.GetInstance().ObjectLocationImagesPath;
                    var all_images = Directory.GetFiles(res_folder + img_path).ToList();

                    current_subject.AllObjectImages = all_images;
                    last_picture_display_time       = DateTime.MinValue;
                    current_image_index             = 0;

                    for (int i = 0; i < all_images.Count; i++)
                    {
                        var loc_x = MathHelperMethods.RandomNumbers.Next(1, Convert.ToInt32(grid_columns) - 1);
                        var loc_y = MathHelperMethods.RandomNumbers.Next(1, Convert.ToInt32(grid_rows) - 1);
                        current_subject.AllObjectImageLocations.Add(new Tuple <int, int>(loc_x, loc_y));
                    }

                    //Save all of the object locations to a file
                    ObjectLocation_FileHandler.WriteAllObjectLocationsToFile(current_subject);
                }

                //Create a shuffled list of image indices for this study session
                var all_indices = Enumerable.Range(0, current_subject.AllObjectImages.Count).ToList();
                shuffled_list_of_image_indices = MathHelperMethods.ShuffleList(all_indices);

                //Create a file for this study session
                fid = StudyBlock.CreateStudyBlockFile(current_subject.UserName);

                HasPhaseStarted = true;
                StartTime       = DateTime.Now;
            }
        }