public void Init() { ExperimentStartupController.SetSelectableAndChildrenInteractable(participantSelector.gameObject, false); ExperimentStartupController.SetSelectableAndChildrenInteractable(form.gameObject, false); ExperimentStartupController.SetSelectableAndChildrenInteractable(startButton.gameObject, false); SetFromCache(); }
public void SetPPList(DataTable data) { ppList = data; if (ppList == null) { throw new Exception("Error with participant list"); } Debug.Log(string.Format("Loaded: {0}", ppListPath)); List <string> participants = ppList.AsEnumerable().Select(x => x[0].ToString()).ToList(); participantSelector.SetParticipants(participants); participantSelector.SelectNewList(); PlayerPrefs.SetString(ppListLocKey, ppListPath); // enable selector ExperimentStartupController.SetSelectableAndChildrenInteractable(participantSelector.gameObject, true); // enable form ExperimentStartupController.SetSelectableAndChildrenInteractable(form.gameObject, true); // enable start button ExperimentStartupController.SetSelectableAndChildrenInteractable(startButton.gameObject, true); foreach (var dataPoint in startup.participantDataPoints) { if (!ppList.Columns.Contains(dataPoint.internalName)) { ppList.Columns.Add(new DataColumn(dataPoint.internalName, typeof(string))); } } }
public void SetPPList(DataTable data) { ppList = data; if (ppList == null) { throw new Exception("Error with participant list"); } Debug.Log(string.Format("Loaded: {0}", ppListPath)); IEnumerable <string> participants = ppList .AsEnumerable() .Select(x => x[0].ToString()); IEnumerable <string> duplicatedParticipants = participants.GroupBy(x => x) .Where(g => g.Count() > 1) .Select(y => y.Key); foreach (string ppid in duplicatedParticipants) { string s = string.Format("Participant '{0}' is listed multiple times in the participant list. Only the first listing will be used.", ppid); Debug.LogWarning(s); } participantSelector.SetParticipants(participants.Distinct().ToList()); participantSelector.SelectNewList(); PlayerPrefs.SetString(ppListLocKey, ppListPath); // enable selector ExperimentStartupController.SetSelectableAndChildrenInteractable(participantSelector.gameObject, true); // enable form ExperimentStartupController.SetSelectableAndChildrenInteractable(form.gameObject, true); // enable start button ExperimentStartupController.SetSelectableAndChildrenInteractable(startButton.gameObject, true); foreach (var dataPoint in startup.participantDataPoints) { if (!ppList.Columns.Contains(dataPoint.internalName)) { ppList.Columns.Add(new DataColumn(dataPoint.internalName, typeof(string))); } } }
public void SetPPList(DataTable data) { ppList = data; if (ppList == null) { throw new Exception("Error with participant list"); } Debug.Log(string.Format("Loaded: {0}", ppListPath)); List <string> participants = ppList.AsEnumerable().Select(x => x[0].ToString()).ToList(); participantSelector.SetParticipants(participants); participantSelector.SelectNewList(); // enable selector ExperimentStartupController.SetSelectableAndChildrenInteractable(participantSelector.gameObject, true); // enable form ExperimentStartupController.SetSelectableAndChildrenInteractable(form.gameObject, true); // enable start button ExperimentStartupController.SetSelectableAndChildrenInteractable(startButton.gameObject, true); }