private void Window_Drop(object sender, System.Windows.DragEventArgs e)
        {
            // Show analysis result when saved files are dropped
            string[] paths = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];

            if (paths.Length == 1)
            {
                // visualize single answer sheet
                string filepath = paths[0];
                if (System.IO.Path.GetExtension(filepath) == ".json")
                {
                    // Visualize answer sheet when 1 json file is dropped
                    PreviewWindow previewWindow = new PreviewWindow();
                    previewWindow.Show();
                    this.visualizer.VisualizeAnswerSheet(filepath, previewWindow.PreviewCanvas, previewWindow.StepGraphCanvas, true, false, true);
                }
                else if (Directory.Exists(filepath))
                {
                    // Group answer sheets when directory is dropped.
                    this.analyzer.GroupAnswerSheet(filepath);
                    AnswerGroupWindow groupWindow = new AnswerGroupWindow(this.analyzer, this.visualizer);
                    groupWindow.Show();
                }
            }
            else if (paths.Length == 2)
            {
                string filepath1 = paths[0];
                string filepath2 = paths[1];
                if (System.IO.Path.GetExtension(filepath1) == ".json"
                    && System.IO.Path.GetExtension(filepath2) == ".json")
                {
                    // visualize answer sheets comparison when 2 json files are dropped
                    ComparisonWindow comparisonWindow = new ComparisonWindow();
                    comparisonWindow.Show();
                    this.visualizer.VisualizeAnswerSheetComparison(filepath1, filepath2, comparisonWindow.PreviewCanvas1, comparisonWindow.PreviewCanvas2, comparisonWindow.GraphCanvas);
                }
            }
        }
 private void BtnGroupAnswerSheets_Click(object sender, RoutedEventArgs e)
 {
     FolderBrowserDialog fbd = new FolderBrowserDialog();
     fbd.Description = "Select directory which have answer sheet data (*.json)";
     fbd.RootFolder = Environment.SpecialFolder.Desktop;
     if (fbd.ShowDialog(this) == true)
     {
         this.analyzer.GroupAnswerSheet(fbd.SelectedPath);
         AnswerGroupWindow w = new AnswerGroupWindow(this.analyzer, this.visualizer);
         w.Show();
     }
 }