Exemple #1
0
        public LineFrequency(IWpfTextView inview, DateTime dt)
        {
            view               = inview;
            this.start         = dt;
            startTimes         = new List <DateTime>();
            endTimes           = new List <DateTime>();
            lineCounters       = new List <int[]>();
            currentLineCounter = new int[view.TextSnapshot.LineCount];
            mtracker           = new MouseTracker(inview);
            eyetracker         = new EyeTracker(inview);

            SetupTimer();
        }
Exemple #2
0
        public ClassManager(String className, IWpfTextView textView)
        {
            //get coordinate of corners of editor.
            this.className = className;

            this.textView = textView;
            DateTime dt = DateTime.Now;

            configureTimer();
            lineFrequency        = new LineFrequency(textView, dt);
            mouseTracker         = new MouseTracker(textView, dt);
            caretTracker         = new CaretTracker(textView, dt);
            timeTracker          = new TimeTracker(textView, dt);
            eyeTracker           = new EyeTracker(textView, dt);
            textHighlightTracker = new TextHighlightTracker(textView, dt);
            SubscribeToListeners();
        }
Exemple #3
0
        private static void exportMouse(String path, MouseTracker mouse)
        {
            String fileName = path + "/" + "mouse_tracker.txt";

            using (StreamWriter tw = new StreamWriter(fileName, true))
            {
                for (int i = 0; i < mouse.getNumberOfSessions() - 1; i++)
                {
                    tw.WriteLine("Start session:" + mouse.getStartTimes()[i]);
                    tw.WriteLine("-----");
                    for (int j = 0; j < mouse.getLineCounters()[i].Count(); j++)
                    {
                        tw.WriteLine(j + 1 + "," + mouse.getLineCounters()[i][j]);
                    }
                    tw.WriteLine("-----");
                    tw.WriteLine("End session:" + mouse.getEndTimes()[i]);
                    tw.WriteLine("----------");
                }
                tw.Close();
            }
        }
Exemple #4
0
        public static void export(String className, DateTime now, LineFrequency lineFrequency, TextHighlightTracker textHighlight, CaretTracker caret, MouseTracker mouse, TimeTracker time, EyeTracker eye)
        {
            Debug.WriteLine("Dumping results into text file");
            //Create dateTime string to name our directory.
            String dateTime = now.ToLongDateString() + "_" + now.ToLongTimeString();

            dateTime = dateTime.Replace(":", "-");
            dateTime = dateTime.Replace("/", "--");
            //escape any characters in className
            className = className.Replace(":", "-");
            className = className.Replace("/", "--");


            //create directory
            String path = "/" + className + "/" + dateTime;

            Directory.CreateDirectory(path);

            //now that it's created, let's start exporting data.
            exportLineFrequency(path, lineFrequency);
            exportTextHighlight(path, textHighlight);
            exportCaret(path, caret);
            exportMouse(path, mouse);
            exportTime(path, time);
            exportEye(path, eye);
        }