コード例 #1
0
        private TextBlock GetTopicSummary(TopicReport report, ReportParameters param, bool total)
        {
            var txt = "  Cumulative duration: " + TimeSpan.FromSeconds(report.cumulativeDuration) + "\r\n";

            var nUsr = 0;

            if (total)
            {
                nUsr = report.GetNumAccumulatedParticipantsAmong();
            }
            else
            {
                nUsr = report.GetNumParticipantsAmong(param.requiredUsers);
            }
            txt += "  No. of users: " + nUsr + "\r\n";
            txt += "  No. of arg. points: " + report.numPoints + "\r\n";
            txt += "  No. of arg. points with description: " + report.numPointsWithDescription + "\r\n";
            txt += "  No. of media attachments: " + report.numMediaAttachments + "\r\n";
            txt += "  No. of sources: " + report.numSources + "\r\n";
            txt += "  No. of comments: " + report.numComments + "\r\n";
            if (!total)
            {
                txt += "  No. of clustered badges: " + report.numClusteredBadges + "\r\n";
            }
            txt += "  No. of clusters: " + report.numClusters + "\r\n";
            txt += "  No. of links: " + report.numLinks;

            var res = new TextBlock();

            res.Text = txt;
            return(res);
        }
コード例 #2
0
        private TreeViewItem GetTotalTopicSummary(TopicReport report)
        {
            var res = new TreeViewItem();

            res.Header = "<all topics total>";
            res.Items.Add(GetTopicSummary(report, null, true));
            return(res);
        }
コード例 #3
0
ファイル: CsvExporter.cs プロジェクト: gdlprj/duscusys
 public static void Export(string reportPathName,
                           TopicReport topicReport1, ReportParameters params1,
                           EventTotalsReport eventTotals1,
                           TopicReport topicReport2, ReportParameters params2,
                           EventTotalsReport eventTotals2)
 {
     try
     {
         System.IO.File.WriteAllText(reportPathName, Export(topicReport1, params1, eventTotals1,
             topicReport2, params2, eventTotals2));
     }
     catch (IOException x)
     {
         MessageDlg.Show(x.ToString());
     }
 }
コード例 #4
0
 public static void Export(string reportPathName,
                           TopicReport topicReport1, ReportParameters params1,
                           EventTotalsReport eventTotals1,
                           TopicReport topicReport2, ReportParameters params2,
                           EventTotalsReport eventTotals2)
 {
     try
     {
         System.IO.File.WriteAllText(reportPathName, Export(topicReport1, params1, eventTotals1,
                                                            topicReport2, params2, eventTotals2));
     }
     catch (IOException x)
     {
         MessageDlg.Show(x.ToString());
     }
 }
コード例 #5
0
        public ReportCollector(TopicReportReady topicReportReady,
                               ReportReady reportGenerated,
                               ReportParameters reportParams,
                               object param, DiscussionsClientRT.ClientRT clientRt)
        {
            _reportParams = reportParams;

            _param    = param;
            _clientRT = clientRt;

            _ctx = new DiscCtx(Discussions.ConfigManager.ConnStr);

            _topicReportReady = topicReportReady;

            _allTopicsReport = new TopicReport(null, 0, 0, 0, 0, 0, 0, null, null, 0, 0, 0, 0, 0, 0, 0);

            _reportGenerated = reportGenerated;

            setListeners(true);

            topics = new List <Topic>()
            {
                _reportParams.topic
            };

            prepareArgPointReports();

            prepareEvents();

            if (topics.Count() > 0)
            {
                _clientRT.dEditorReportResponse += dEditorReportResponse;
                _clientRT.SendDEditorRequest(topics.First().Id);
            }
            else
            {
                finalizeReport();
            }
        }
コード例 #6
0
        private TreeViewItem GetTopicReport(TopicReport report, ReportCollector collector)
        {
            var res = new TreeViewItem();

            res.Items.Add(GetTopicSummary(report, collector.ReportParams, false));
            res.Header = "Basic summary - " + report.topic.Name;

            //clusters
            var clusters = WrapNode("Clusters");

            foreach (var clustReport in collector.ClusterReports)
            {
                if (clustReport.topic.Id != report.topic.Id)
                {
                    continue;
                }

                clusters.Items.Add(GetCluster(clustReport));
            }
            res.Items.Add(clusters);

            //links
            var links = WrapNode("Links");

            foreach (var linkReport in collector.LinkReports)
            {
                if (linkReport.topicId != report.topic.Id)
                {
                    continue;
                }

                links.Items.Add(GetLink(linkReport, collector));
            }
            res.Items.Add(links);

            return(res);
        }
コード例 #7
0
        private TextBlock GetTopicSummary(TopicReport report, ReportParameters param, bool total)
        {
            var txt = "  Cumulative duration: " + TimeSpan.FromSeconds(report.cumulativeDuration) + "\r\n";

            var nUsr = 0;
            if (total)
                nUsr = report.GetNumAccumulatedParticipantsAmong();
            else
                nUsr = report.GetNumParticipantsAmong(param.requiredUsers);
            txt += "  No. of users: " + nUsr + "\r\n";
            txt += "  No. of arg. points: " + report.numPoints + "\r\n";
            txt += "  No. of arg. points with description: " + report.numPointsWithDescription + "\r\n";
            txt += "  No. of media attachments: " + report.numMediaAttachments + "\r\n";
            txt += "  No. of sources: " + report.numSources + "\r\n";
            txt += "  No. of comments: " + report.numComments + "\r\n";
            if (!total)
                txt += "  No. of clustered badges: " + report.numClusteredBadges + "\r\n";
            txt += "  No. of clusters: " + report.numClusters + "\r\n";
            txt += "  No. of links: " + report.numLinks;

            var res = new TextBlock();
            res.Text = txt;
            return res;
        }
コード例 #8
0
        private TreeViewItem GetTopicReport(TopicReport report, ReportCollector collector)
        {
            var res = new TreeViewItem();
            res.Items.Add(GetTopicSummary(report, collector.ReportParams, false));
            res.Header = "Basic summary - " + report.topic.Name;

            //clusters
            var clusters = WrapNode("Clusters");
            foreach (var clustReport in collector.ClusterReports)
            {
                if (clustReport.topic.Id != report.topic.Id)
                    continue;

                clusters.Items.Add(GetCluster(clustReport));
            }
            res.Items.Add(clusters);

            //links            
            var links = WrapNode("Links");
            foreach (var linkReport in collector.LinkReports)
            {
                if (linkReport.topicId != report.topic.Id)
                    continue;

                links.Items.Add(GetLink(linkReport, collector));
            }
            res.Items.Add(links);

            return res;
        }
コード例 #9
0
 private TreeViewItem GetTotalTopicSummary(TopicReport report)
 {
     var res = new TreeViewItem();
     res.Header = "<all topics total>";
     res.Items.Add(GetTopicSummary(report, null, true));
     return res;
 }
コード例 #10
0
 private static void AddSessionTopicRow(StringBuilder sb, TopicReport topicReport1,
                                        ReportParameters params1,
                                        EventTotalsReport eventTotals1)
 {
     sb.Append("\"" + params1.session.Name + "\"");
     sb.Append(";");
     sb.Append("\"" + params1.topic.Name + "\"");
     sb.Append(";");
     sb.Append(params1.sessionTopicUsers.Count());
     sb.Append(";");
     sb.Append(topicReport1.numImages);
     sb.Append(";");
     sb.Append(topicReport1.numScreenshots);
     sb.Append(";");
     sb.Append(topicReport1.numPDFs);
     sb.Append(";");
     sb.Append(topicReport1.numYoutubes);
     sb.Append(";");
     sb.Append(TimeSpan.FromSeconds(topicReport1.cumulativeDuration).ToString());
     sb.Append(";");
     sb.Append(topicReport1.numClusteredBadges.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numClusters.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numComments.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numLinks.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numMediaAttachments.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numPoints.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numPointsWithDescription.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numSources.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalRecordingStarted.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalRecordingStopped.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeEdited.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeZoomIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterDeleted.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterOut.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesEdited.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLinkCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLinkRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingResize.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSceneZoomedIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSceneZoomedOut.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalArgPointTopicChanged.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageUrlAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfUrlAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalYoutubeAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalScreenshotAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalMediaRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalCommentAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalCommentRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalVideoOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalScreenshotOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLaserEnabled.ToString() + ";");
 }
コード例 #11
0
        private static string Export(TopicReport topicReport1, ReportParameters params1,
                                     EventTotalsReport eventTotals1,
                                     TopicReport topicReport2, ReportParameters params2,
                                     EventTotalsReport eventTotals2)
        {
            //write header
            var sb = new StringBuilder();

            sb.Append("SessionName;");
            sb.Append("TopicName;");
            sb.Append("NumUsers;");
            sb.Append("NumImages;");
            sb.Append("NumScreenshots;");
            sb.Append("NumPDFs;");
            sb.Append("NumVideos;");
            sb.Append("CumulativeDuration;");
            sb.Append("NumClusteredBadges;");
            sb.Append("NumClusters;");
            sb.Append("NumComments;");
            sb.Append("NumLinks;");
            sb.Append("NumMediaAttachments;");
            sb.Append("NumPoints;");
            sb.Append("NumPointsWithDescription;");
            sb.Append("NumSources;");
            sb.Append("TotalRecordingStarted;");
            sb.Append("TotalRecordingStopped;");
            sb.Append("TotalBadgeCreated;");
            sb.Append("TotalBadgeEdited;");
            sb.Append("TotalBadgeMoved;");
            sb.Append("TotalBadgeZoomIn;");
            sb.Append("TotalClusterCreated;");
            sb.Append("TotalClusterDeleted;");
            sb.Append("TotalClusterIn;");
            sb.Append("TotalClusterOut;");
            sb.Append("TotalClusterMoved;");
            sb.Append("TotalClusterTitlesAdded;");
            sb.Append("TotalClusterTitlesEdited;");
            sb.Append("TotalClusterTitlesRemoved;");
            sb.Append("TotalLinkCreated;");
            sb.Append("TotalLinkRemoved;");
            sb.Append("TotalFreeDrawingCreated;");
            sb.Append("TotalFreeDrawingRemoved;");
            sb.Append("TotalFreeDrawingResize;");
            sb.Append("TotalFreeDrawingMoved;");
            sb.Append("TotalSceneZoomedIn;");
            sb.Append("TotalSceneZoomedOut;");
            sb.Append("TotalArgPointTopicChanged;");
            sb.Append("TotalSourceAdded;");
            sb.Append("TotalSourceRemoved;");
            sb.Append("TotalImageAdded;");
            sb.Append("TotalImageUrlAdded;");
            sb.Append("TotalPdfAdded;");
            sb.Append("TotalPdfUrlAdded;");
            sb.Append("TotalYoutubeAdded;");
            sb.Append("TotalScreenshotAdded;");
            sb.Append("TotalMediaRemoved;");
            sb.Append("TotalCommentAdded;");
            sb.Append("TotalCommentRemoved;");
            sb.Append("TotalImageOpened;");
            sb.Append("TotalVideoOpened;");
            sb.Append("TotalScreenshotOpened;");
            sb.Append("TotalPdfOpened;");
            sb.Append("TotalSourceOpened;");
            sb.AppendLine("TotalLaserEnabled;");

            //first line
            AddSessionTopicRow(sb, topicReport1, params1, eventTotals1);

            //second line
            if (topicReport2 != null && params2 != null && eventTotals2 != null)
            {
                AddSessionTopicRow(sb, topicReport2, params2, eventTotals2);
            }

            return(sb.ToString());
        }
コード例 #12
0
ファイル: ReportCollector.cs プロジェクト: gdlprj/duscusys
        public ReportCollector(TopicReportReady topicReportReady,
                               ReportReady reportGenerated,
                               ReportParameters reportParams,
                               object param, DiscussionsClientRT.ClientRT clientRt)
        {
            _reportParams = reportParams;

            _param = param;
            _clientRT = clientRt;

            _ctx = new DiscCtx(Discussions.ConfigManager.ConnStr);

            _topicReportReady = topicReportReady;

            _allTopicsReport = new TopicReport(null, 0, 0, 0, 0, 0, 0, null, null, 0, 0, 0, 0, 0, 0, 0);

            _reportGenerated = reportGenerated;

            setListeners(true);

            topics = new List<Topic>() {_reportParams.topic};

            prepareArgPointReports();

            prepareEvents();

            if (topics.Count() > 0)
            {
                _clientRT.dEditorReportResponse += dEditorReportResponse;
                _clientRT.SendDEditorRequest(topics.First().Id);
            }
            else
            {
                finalizeReport();
            }
        }
コード例 #13
0
        private void dEditorReportResponse(DEditorStatsResponse stats)
        {
            //process
            var topic = _ctx.Topic.FirstOrDefault(t0 => t0.Id == stats.TopicId);

            int numSrc;
            int numComments;
            int numImages;
            int numScreenshots;
            int numPdfs;
            int numYoutubes;

            ArgPointTotalsOverTopic(_reportParams, topic, out numSrc, out numComments,
                                    out numImages, out numPdfs, out numScreenshots, out numYoutubes);

            _allTopicsReport.numClusters        += stats.NumClusters;
            _allTopicsReport.numClusteredBadges += stats.NumClusteredBadges;
            _allTopicsReport.numLinks           += stats.NumLinks;
            _allTopicsReport.numSources         += numSrc;
            _allTopicsReport.numComments        += numComments;
            _allTopicsReport.numImages          += numImages;
            _allTopicsReport.numPDFs            += numPdfs;
            _allTopicsReport.numYoutubes        += numYoutubes;
            _allTopicsReport.numScreenshots     += numScreenshots;
            _allTopicsReport.cumulativeDuration += topic.CumulativeDuration;
            var numArgPoints = topic.ArgPoint.Count();

            _allTopicsReport.numPoints += numArgPoints;
            var numPointsWithDescription = topic.ArgPoint.Where(ap0 => ap0.Description != null && ap0.Description.Text != "Description").Count();

            _allTopicsReport.numPointsWithDescription += numPointsWithDescription;
            //num media
            var nMedia = 0;

            foreach (var ap in topic.ArgPoint)
            {
                nMedia += ap.Attachment.Count();
            }
            _allTopicsReport.numMediaAttachments += nMedia;

            var report = new TopicReport(topic, stats.NumClusters, stats.NumClusteredBadges,
                                         stats.NumLinks, numSrc, numComments,
                                         topic.CumulativeDuration, stats.ListOfClusterIds,
                                         stats.ListOfLinkIds, numArgPoints,
                                         numPointsWithDescription, nMedia,
                                         numImages, numPdfs, numScreenshots, numYoutubes);

            _topicReports.Add(report);
            if (_topicReportReady != null)
            {
                _topicReportReady(report);
            }

            if (++_nProcessedTopics >= topics.Count())
            {
                _clientRT.dEditorReportResponse -= dEditorReportResponse;

                //all topics processed, request clusters
                bool hasClusters = false;
                bool hasLinks    = false;
                foreach (var topicReport in _topicReports)
                {
                    foreach (var clustId in topicReport.clusterIds)
                    {
                        _clientRT.SendClusterStatsRequest(clustId, topicReport.topic.Id);
                        hasClusters = true;
                    }
                    foreach (var linkId in topicReport.linkIds)
                    {
                        _clientRT.SendLinkStatsRequest(linkId, topicReport.topic.Id);
                        hasLinks = true;
                    }
                }
                if (!hasClusters && !hasLinks)
                {
                    finalizeReport();
                }
            }
            //else
            //{
            //    UISharedRTClient.Instance.clienRt.SendDEditorRequest(topics[nextTopicIdx++].Id);
            //}
        }
コード例 #14
0
ファイル: ReportCollector.cs プロジェクト: gdlprj/duscusys
        public static TopicReport GetTotalTopicsReports(TopicReport topic1, TopicReport topic2,
                                                        List<int> sessionParticipants)
        {
            var res = new TopicReport();
            var topicsDifferent = topic1.topic.Id != topic2.topic.Id;

            if (topicsDifferent)
                res.cumulativeDuration = topic1.cumulativeDuration + topic2.cumulativeDuration;
            else
                res.cumulativeDuration = topic1.cumulativeDuration;

            //what to report?
            ///res.numClusteredBadges += topic1.numClusteredBadges + topic2.numClusteredBadges;

            //participants
            res.accumulatedParticipants = new List<int>();
            foreach (var usr in topic1.topic.Person)
                if (!res.accumulatedParticipants.Contains(usr.Id) && sessionParticipants.Contains(usr.Id))
                    res.accumulatedParticipants.Add(usr.Id);
            foreach (var usr in topic2.topic.Person)
                if (!res.accumulatedParticipants.Contains(usr.Id) && sessionParticipants.Contains(usr.Id))
                    res.accumulatedParticipants.Add(usr.Id);

            //number of unique clusters
            var clusterIds = new List<int>();
            foreach (var cid in topic1.clusterIds)
                if (!clusterIds.Contains(cid))
                    clusterIds.Add(cid);
            foreach (var cid in topic2.clusterIds)
                if (!clusterIds.Contains(cid))
                    clusterIds.Add(cid);
            res.numClusters = clusterIds.Count();

            //number of unique links
            var linkIds = new List<int>();
            foreach (var lid in topic1.linkIds)
                if (!linkIds.Contains(lid))
                    linkIds.Add(lid);
            foreach (var lid in topic2.linkIds)
                if (!linkIds.Contains(lid))
                    linkIds.Add(lid);
            res.numLinks = linkIds.Count();

            //number of unique points
            var uniquePoints = new List<ArgPoint>();
            foreach (var ap in topic1.topic.ArgPoint)
                if (!uniquePoints.Contains(ap))
                    uniquePoints.Add(ap);
            res.numPoints = uniquePoints.Count();

            foreach (var ap in uniquePoints)
            {
                if (ap.Description.Text != "Description")
                    res.numPointsWithDescription += 1;

                foreach (var c in ap.Comment)
                    if (c.Text != "New feedback" && res.accumulatedParticipants.Contains(c.Person.Id))
                        ++res.numComments;

                foreach (var a in ap.Attachment)
                    if (sessionParticipants.Contains(a.Person.Id))
                        ++res.numMediaAttachments;

                if (res.accumulatedParticipants.Contains(ap.Person.Id))
                    res.numSources += ap.Description.Source.Count();
            }

            return res;
        }
コード例 #15
0
        public static TopicReport GetTotalTopicsReports(TopicReport topic1, TopicReport topic2,
                                                        List <int> sessionParticipants)
        {
            var res             = new TopicReport();
            var topicsDifferent = topic1.topic.Id != topic2.topic.Id;

            if (topicsDifferent)
            {
                res.cumulativeDuration = topic1.cumulativeDuration + topic2.cumulativeDuration;
            }
            else
            {
                res.cumulativeDuration = topic1.cumulativeDuration;
            }

            //what to report?
            ///res.numClusteredBadges += topic1.numClusteredBadges + topic2.numClusteredBadges;

            //participants
            res.accumulatedParticipants = new List <int>();
            foreach (var usr in topic1.topic.Person)
            {
                if (!res.accumulatedParticipants.Contains(usr.Id) && sessionParticipants.Contains(usr.Id))
                {
                    res.accumulatedParticipants.Add(usr.Id);
                }
            }
            foreach (var usr in topic2.topic.Person)
            {
                if (!res.accumulatedParticipants.Contains(usr.Id) && sessionParticipants.Contains(usr.Id))
                {
                    res.accumulatedParticipants.Add(usr.Id);
                }
            }

            //number of unique clusters
            var clusterIds = new List <int>();

            foreach (var cid in topic1.clusterIds)
            {
                if (!clusterIds.Contains(cid))
                {
                    clusterIds.Add(cid);
                }
            }
            foreach (var cid in topic2.clusterIds)
            {
                if (!clusterIds.Contains(cid))
                {
                    clusterIds.Add(cid);
                }
            }
            res.numClusters = clusterIds.Count();

            //number of unique links
            var linkIds = new List <int>();

            foreach (var lid in topic1.linkIds)
            {
                if (!linkIds.Contains(lid))
                {
                    linkIds.Add(lid);
                }
            }
            foreach (var lid in topic2.linkIds)
            {
                if (!linkIds.Contains(lid))
                {
                    linkIds.Add(lid);
                }
            }
            res.numLinks = linkIds.Count();

            //number of unique points
            var uniquePoints = new List <ArgPoint>();

            foreach (var ap in topic1.topic.ArgPoint)
            {
                if (!uniquePoints.Contains(ap))
                {
                    uniquePoints.Add(ap);
                }
            }
            res.numPoints = uniquePoints.Count();

            foreach (var ap in uniquePoints)
            {
                if (ap.Description.Text != "Description")
                {
                    res.numPointsWithDescription += 1;
                }

                foreach (var c in ap.Comment)
                {
                    if (c.Text != "New feedback" && res.accumulatedParticipants.Contains(c.Person.Id))
                    {
                        ++res.numComments;
                    }
                }

                foreach (var a in ap.Attachment)
                {
                    if (sessionParticipants.Contains(a.Person.Id))
                    {
                        ++res.numMediaAttachments;
                    }
                }

                if (res.accumulatedParticipants.Contains(ap.Person.Id))
                {
                    res.numSources += ap.Description.Source.Count();
                }
            }

            return(res);
        }
コード例 #16
0
ファイル: CsvExporter.cs プロジェクト: gdlprj/duscusys
        private static string Export(TopicReport topicReport1, ReportParameters params1,
                                     EventTotalsReport eventTotals1,
                                     TopicReport topicReport2, ReportParameters params2,
                                     EventTotalsReport eventTotals2)
        {
            //write header
            var sb = new StringBuilder();
            sb.Append("SessionName;");
            sb.Append("TopicName;");
            sb.Append("NumUsers;");
            sb.Append("NumImages;");
            sb.Append("NumScreenshots;");
            sb.Append("NumPDFs;");
            sb.Append("NumVideos;");
            sb.Append("CumulativeDuration;");
            sb.Append("NumClusteredBadges;");
            sb.Append("NumClusters;");
            sb.Append("NumComments;");
            sb.Append("NumLinks;");
            sb.Append("NumMediaAttachments;");
            sb.Append("NumPoints;");
            sb.Append("NumPointsWithDescription;");
            sb.Append("NumSources;");
            sb.Append("TotalRecordingStarted;");
            sb.Append("TotalRecordingStopped;");
            sb.Append("TotalBadgeCreated;");
            sb.Append("TotalBadgeEdited;");
            sb.Append("TotalBadgeMoved;");
            sb.Append("TotalBadgeZoomIn;");
            sb.Append("TotalClusterCreated;");
            sb.Append("TotalClusterDeleted;");
            sb.Append("TotalClusterIn;");
            sb.Append("TotalClusterOut;");
            sb.Append("TotalClusterMoved;");
            sb.Append("TotalClusterTitlesAdded;");
            sb.Append("TotalClusterTitlesEdited;");
            sb.Append("TotalClusterTitlesRemoved;");
            sb.Append("TotalLinkCreated;");
            sb.Append("TotalLinkRemoved;");
            sb.Append("TotalFreeDrawingCreated;");
            sb.Append("TotalFreeDrawingRemoved;");
            sb.Append("TotalFreeDrawingResize;");
            sb.Append("TotalFreeDrawingMoved;");
            sb.Append("TotalSceneZoomedIn;");
            sb.Append("TotalSceneZoomedOut;");
            sb.Append("TotalArgPointTopicChanged;");
            sb.Append("TotalSourceAdded;");
            sb.Append("TotalSourceRemoved;");
            sb.Append("TotalImageAdded;");
            sb.Append("TotalImageUrlAdded;");
            sb.Append("TotalPdfAdded;");
            sb.Append("TotalPdfUrlAdded;");
            sb.Append("TotalYoutubeAdded;");
            sb.Append("TotalScreenshotAdded;");
            sb.Append("TotalMediaRemoved;");
            sb.Append("TotalCommentAdded;");
            sb.Append("TotalCommentRemoved;");
            sb.Append("TotalImageOpened;");
            sb.Append("TotalVideoOpened;");
            sb.Append("TotalScreenshotOpened;");
            sb.Append("TotalPdfOpened;");
            sb.Append("TotalSourceOpened;");
            sb.AppendLine("TotalLaserEnabled;");

            //first line
            AddSessionTopicRow(sb, topicReport1, params1, eventTotals1);

            //second line
            if (topicReport2 != null && params2 != null && eventTotals2 != null)
                AddSessionTopicRow(sb, topicReport2, params2, eventTotals2);

            return sb.ToString();
        }
コード例 #17
0
ファイル: CsvExporter.cs プロジェクト: gdlprj/duscusys
 private static void AddSessionTopicRow(StringBuilder sb, TopicReport topicReport1,
                                        ReportParameters params1,
                                        EventTotalsReport eventTotals1)
 {
     sb.Append("\"" + params1.session.Name + "\"");
     sb.Append(";");
     sb.Append("\"" + params1.topic.Name + "\"");
     sb.Append(";");
     sb.Append(params1.sessionTopicUsers.Count());
     sb.Append(";");
     sb.Append(topicReport1.numImages);
     sb.Append(";");
     sb.Append(topicReport1.numScreenshots);
     sb.Append(";");
     sb.Append(topicReport1.numPDFs);
     sb.Append(";");
     sb.Append(topicReport1.numYoutubes);
     sb.Append(";");
     sb.Append(TimeSpan.FromSeconds(topicReport1.cumulativeDuration).ToString());
     sb.Append(";");
     sb.Append(topicReport1.numClusteredBadges.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numClusters.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numComments.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numLinks.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numMediaAttachments.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numPoints.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numPointsWithDescription.ToString());
     sb.Append(";");
     sb.Append(topicReport1.numSources.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalRecordingStarted.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalRecordingStopped.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeEdited.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalBadgeZoomIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterDeleted.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterOut.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesEdited.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalClusterTitlesRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLinkCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLinkRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingCreated.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingResize.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalFreeDrawingMoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSceneZoomedIn.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSceneZoomedOut.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalArgPointTopicChanged.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageUrlAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfUrlAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalYoutubeAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalScreenshotAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalMediaRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalCommentAdded.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalCommentRemoved.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalImageOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalVideoOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalScreenshotOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalPdfOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalSourceOpened.ToString());
     sb.Append(";");
     sb.Append(eventTotals1.TotalLaserEnabled.ToString() + ";");
 }
コード例 #18
0
ファイル: ReportCollector.cs プロジェクト: gdlprj/duscusys
        private void dEditorReportResponse(DEditorStatsResponse stats)
        {
            //process
            var topic = _ctx.Topic.FirstOrDefault(t0 => t0.Id == stats.TopicId);

            int numSrc;
            int numComments;
            int numImages;
            int numScreenshots;
            int numPdfs;
            int numYoutubes;
            ArgPointTotalsOverTopic(_reportParams, topic, out numSrc, out numComments,
                                    out numImages, out numPdfs, out numScreenshots, out numYoutubes);

            _allTopicsReport.numClusters += stats.NumClusters;
            _allTopicsReport.numClusteredBadges += stats.NumClusteredBadges;
            _allTopicsReport.numLinks += stats.NumLinks;
            _allTopicsReport.numSources += numSrc;
            _allTopicsReport.numComments += numComments;
            _allTopicsReport.numImages += numImages;
            _allTopicsReport.numPDFs += numPdfs;
            _allTopicsReport.numYoutubes += numYoutubes;
            _allTopicsReport.numScreenshots += numScreenshots;
            _allTopicsReport.cumulativeDuration += topic.CumulativeDuration;
            var numArgPoints = topic.ArgPoint.Count();
            _allTopicsReport.numPoints += numArgPoints;
            var numPointsWithDescription = topic.ArgPoint.Where(ap0 => ap0.Description != null && ap0.Description.Text != "Description").Count();
            _allTopicsReport.numPointsWithDescription += numPointsWithDescription;
            //num media
            var nMedia = 0;
            foreach (var ap in topic.ArgPoint)
                nMedia += ap.Attachment.Count();
            _allTopicsReport.numMediaAttachments += nMedia;

            var report = new TopicReport(topic, stats.NumClusters, stats.NumClusteredBadges,
                                         stats.NumLinks, numSrc, numComments,
                                         topic.CumulativeDuration, stats.ListOfClusterIds,
                                         stats.ListOfLinkIds, numArgPoints,
                                         numPointsWithDescription, nMedia,
                                         numImages, numPdfs, numScreenshots, numYoutubes);

            _topicReports.Add(report);
            if (_topicReportReady != null)
                _topicReportReady(report);

            if (++_nProcessedTopics >= topics.Count())
            {
                _clientRT.dEditorReportResponse -= dEditorReportResponse;

                //all topics processed, request clusters 
                bool hasClusters = false;
                bool hasLinks = false;
                foreach (var topicReport in _topicReports)
                {
                    foreach (var clustId in topicReport.clusterIds)
                    {
                        _clientRT.SendClusterStatsRequest(clustId, topicReport.topic.Id);
                        hasClusters = true;
                    }
                    foreach (var linkId in topicReport.linkIds)
                    {
                        _clientRT.SendLinkStatsRequest(linkId, topicReport.topic.Id);
                        hasLinks = true;
                    }
                }
                if (!hasClusters && !hasLinks)
                    finalizeReport();
            }
            //else
            //{
            //    UISharedRTClient.Instance.clienRt.SendDEditorRequest(topics[nextTopicIdx++].Id);  
            //}
        }