public void HandleNumberInput(GameObject source)
        {
            var text = source.GetComponentInChildren <Text>();

            NextNumberText.text += text.text;
            InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "input", text.text));
        }
        void OnEnable()
        {
            _startNumber           = Random.Range(700, 900);
            CurrentNumberText.text = _startNumber.ToString("D");

            NextNumberText.text = string.Empty;

            InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "start", NextNumberText.text, CurrentNumberText.text));

            _trialStartTime = DateTime.Now;
        }
        private void SetTargetIcon()
        {
            var newTargetIndex = 0;

            if (_currentIconIsInSet)
            {
                newTargetIndex = _targetIconIndixes[Random.Range(0, _targetIconIndixes.Count)];
            }
            else
            {
                newTargetIndex = _distractorIconIndices[Random.Range(0, _distractorIconIndices.Count)];
            }


            var path = IconsPath + (newTargetIndex + 1);

            TargetIcon.texture = Resources.Load(path) as Texture2D;

            InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "set_target_icon", newTargetIndex.ToString("D"), path));
        }
        private void BuildIcons()
        {
            var allIcons = new List <int>();

            for (int i = 0; i < Constants.NUM_ICONS_IN_LIBRARY; i++)
            {
                allIcons.Add(i);
            }

            var rawImages = IconsContainer.GetComponentsInChildren <RawImage>();

            _targetIconIndixes = new List <int>();
            for (int i = 0; i < rawImages.Length; i++)
            {
                var randomIndex = Random.Range(0, allIcons.Count);
                _targetIconIndixes.Add(allIcons[randomIndex]);
                allIcons.RemoveAt(randomIndex);
            }

            //_targetIconIndixes = ListUtil.ShuffleList(_targetIconIndixes);

            for (int i = 0; i < rawImages.Length; i++)
            {
                var path = IconsPath + (_targetIconIndixes[i] + 1);
                rawImages[i].texture = Resources.Load(path) as Texture2D;
            }

            _distractorIconIndices = new List <int>(allIcons);

            InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "build_icons", string.Join(",", _targetIconIndixes)));

            //for (int i = 0; i < Constants.NUM_ICONS_IN_LIBRARY; i++)
            //{
            //    if(!_targetIconIndixes.Contains(i))
            //        _distractorIconIndices.Add(i);
            //}
        }
 void OnDisable()
 {
     InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "end"));
 }
 void OnEnable()
 {
     InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "start"));
     _trialStartTime = DateTime.Now;
 }
 void OnDisable()
 {
     InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "end", NextNumberText.text, CurrentNumberText.text));
 }
        public void HandleDelete()
        {
            InteractionHappened?.Invoke(this, new PrimaryTaskInteractionEventArgs(TaskName, _trialCounter, "delete", NextNumberText.text, CurrentNumberText.text, _trialCounter.ToString("D"), _numErrorsInTrial.ToString("D")));

            NextNumberText.text = string.Empty;
        }