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(); }
private static void exportCaret(String path, CaretTracker caret) { String fileName = path + "/" + "caret_tracker.txt"; using (StreamWriter tw = new StreamWriter(fileName, true)) { for (int i = 0; i < caret.getNumberOfSessions() - 1; i++) { tw.WriteLine("Start session:" + caret.getStartTimes()[i]); tw.WriteLine("-----"); for (int j = 0; j < caret.getLineCounters()[i].Count(); j++) { tw.WriteLine(j + 1 + "," + caret.getLineCounters()[i][j]); } tw.WriteLine("-----"); tw.WriteLine("End session:" + caret.getEndTimes()[i]); tw.WriteLine("----------"); } tw.Close(); } }
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); }