public override void Start(HumanSubject current_subject = null) { if (current_subject != null) { current_subject_obj = current_subject; //Get the list of words to use for this test block var hal_config = HumanAcceleratedLearningConfiguration.GetInstance(); source_language_dictionary = hal_config.LanguageDictionaries.Where(x => (x.ForeignLanguageName.Equals(ForeignLanguage) && x.NativeLanguageName.Equals(NativeLanguage)) ).FirstOrDefault(); //Get the list of words that this participant has already gotten correct in previous test blocks current_subject.MakeSureCorrectlyAnsweredWordListExistsForSubject(ForeignLanguage); if (source_language_dictionary != null) { var correct_word_list = current_subject.CorrectlyAnsweredWordList[ForeignLanguage]; var all_word_pairs = source_language_dictionary.DictionaryWordPairs.ToList(); var ordered_foreign_language_Words = all_word_pairs.Select(x => x.Item1).ToList(); //Remove the words from the list of word pairs that have already been answered correctly for (int i = 0; i < correct_word_list.Count; i++) { int index = ordered_foreign_language_Words.IndexOf(correct_word_list[i]); if (index > -1) { ordered_foreign_language_Words.RemoveAt(index); all_word_pairs.RemoveAt(index); } } //Shuffle the remaining words shuffled_word_list = MathHelperMethods.ShuffleList(all_word_pairs); last_word_display_time = DateTime.MinValue; test_start_time = DateTime.Now; current_wordpair_index = 0; //Create a file for this test session fid = TestBlock.CreateTestBlockFile(current_subject.UserName); HasPhaseStarted = true; } } }
public override void Start(HumanSubject current_subject = null) { if (current_subject != null) { _current_subject = current_subject; last_picture_display_time = DateTime.MinValue; current_image_index = 0; if (current_subject.AllObjectImages.Count == 0) { ObjectLocation_FileHandler.ReadObjectLocationFile(current_subject); /*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;*/ } if (current_subject.AllObjectImages.Count > 0) { //Remove images that have already been correctly answered usable_images = current_subject.AllObjectImages.Where((y, x) => !current_subject.CorrectlyAnsweredImageList.Contains(x)).ToList(); usable_image_positions = current_subject.AllObjectImageLocations.Where((y, x) => !current_subject.CorrectlyAnsweredImageList.Contains(x)).ToList(); //Create a shuffled list of image indices for this study session var all_indices = Enumerable.Range(0, usable_images.Count).ToList(); shuffled_list_of_image_indices = MathHelperMethods.ShuffleList(all_indices); //Create a file for this study session fid = TestBlock.CreateTestBlockFile(current_subject.UserName); HasPhaseStarted = true; StartTime = DateTime.Now; } } }