Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        private static void exportTextHighlight(String path, TextHighlightTracker textHighlight)
        {
            String fileName = path + "/" + "text_highlight.txt";

            using (StreamWriter tw = new StreamWriter(fileName, true))
            {
                for (int i = 0; i < textHighlight.getNumberOfSessions() - 1; i++)
                {
                    tw.WriteLine("Start session:" + textHighlight.getStartTimes()[i]);
                    tw.WriteLine("-----");
                    for (int j = 0; j < textHighlight.getLineCounters()[i].Count(); j++)
                    {
                        tw.WriteLine(j + 1 + "," + textHighlight.getLineCounters()[i][j]);
                    }
                    tw.WriteLine("-----");
                    tw.WriteLine("End session:" + textHighlight.getEndTimes()[i]);
                    tw.WriteLine("----------");
                }
                tw.Close();
            }
        }
Exemplo n.º 3
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);
        }