Exemple #1
0
        public static void GetInvalidCounts(DataSource source)
        {
            var attempts = AttemptRepository.GetAttempts(source, false);

            Console.WriteLine($"Information for {source} experiment\n");
            foreach (var direction in AllDirections)
            {
                foreach (var technique in AllTechniques)
                {
                    var all     = attempts.Where(x => x.Type == technique && x.Direction == direction);
                    var invalid = attempts.Where(x => x.Type == technique && x.Direction == direction && x.Valid == false);
                    Console.WriteLine($"{technique},{direction} : \t All: {all.Count()} \t Invalid: {invalid.Count()}");
                }
            }
            Console.WriteLine("\n");
        }
Exemple #2
0
        public static void InvalidateTechniqueAttempts(DataSource source, int userId, GestureType type, GestureDirection direction)
        {
            var attempts = AttemptRepository.GetAttempts(source, false);
            var modified = from attempt in attempts
                           where    attempt.ID == userId.ToString() &&
                           attempt.Type == type &&
                           attempt.Direction == direction &&
                           attempt.Source == source
                           select attempt;


            foreach (var attempt in modified)
            {
                attempt.Valid = false;
            }
            AttemptRepository.UpdateAttempt(modified);
        }