From 1e4ded7122b264547f038a8a300f012d3e80d4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 25 Dec 2014 21:00:12 +0100 Subject: [PATCH] Version 14.40.10 --- swad_changelog.h | 3 +- swad_statistic.c | 492 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 355 insertions(+), 140 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index bdc952019..637480637 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -35,11 +35,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.40.9 (2014/12/25)" +#define Log_PLATFORM_VERSION "SWAD 14.40.10 (2014/12/25)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1 /* + Version 14.40.10 :Dic 25, 2014 Changes in HTML and CSS to validate HTML5 in W3C validator. (173201 lines) Version 14.40.9 :Dic 25, 2014 Changes in HTML and CSS to validate HTML5 in W3C validator. (172986 lines) Version 14.40.8 :Dic 24, 2014 Changes in HTML and CSS to validate HTML5 in W3C validator. (172653 lines) Version 14.40.7 :Dic 23, 2014 Changes in HTML and CSS to validate HTML5 in W3C validator. (172552 lines) diff --git a/swad_statistic.c b/swad_statistic.c index 0f651c067..f8d57d910 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -2701,7 +2701,8 @@ static void Sta_WriteAccessHour (unsigned Hour,float NumPagesGenerated,float Max if (NumPagesGenerated > 0.0) { fprintf (Gbl.F.Out,"%u%%
", - (unsigned) (((NumPagesGenerated * 100.0) / TotalPagesGenerated) + 0.5)); + (unsigned) (((NumPagesGenerated * 100.0) / + TotalPagesGenerated) + 0.5)); Sta_WriteFloatNum (NumPagesGenerated); fprintf (Gbl.F.Out,"
"); AltoBarra = (unsigned) (((NumPagesGenerated * 400.0) / MaxPagesGenerated) + 0.5); @@ -3460,7 +3461,8 @@ static void Sta_DrawBarNumClicks (char Color,float NumPagesGenerated,float MaxPa /* Write the number of clicks */ Sta_WriteFloatNum (NumPagesGenerated); fprintf (Gbl.F.Out," (%u", - (unsigned) (((NumPagesGenerated * 100.0) / TotalPagesGenerated) + 0.5)); + (unsigned) (((NumPagesGenerated * 100.0) / + TotalPagesGenerated) + 0.5)); } else /* Write the number of clicks */ @@ -4451,7 +4453,8 @@ static void Sta_WriteRowStatsExpTrees (Brw_FileBrowser_t FileZone,const char *Na struct Sta_SizeOfFileZones SizeOfFileZones; char *ClassData = (FileZone == Brw_FILE_BRW_UNKNOWN) ? "DAT_N" : "DAT"; - char *StyleTableCell = (FileZone == Brw_FILE_BRW_UNKNOWN) ? " style=\"border-style:solid none none none;border-width:1px;\"" : + char *StyleTableCell = (FileZone == Brw_FILE_BRW_UNKNOWN) ? " border-style:solid none none none;" + " border-width:1px;" : ""; Sta_GetSizeOfFileZoneFromDB (Gbl.Scope.Current,FileZone,&SizeOfFileZones); @@ -4465,10 +4468,12 @@ static void Sta_WriteRowStatsExpTrees (Brw_FileBrowser_t FileZone,const char *Na { sprintf (StrNumCrss,"%d",SizeOfFileZones.NumCrss); sprintf (StrNumFoldersPerCrs,"%.1f", - SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.NumFolders / (double) SizeOfFileZones.NumCrss : + SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.NumFolders / + (double) SizeOfFileZones.NumCrss : 0.0); sprintf (StrNumFilesPerCrs,"%.1f", - SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.NumFiles / (double) SizeOfFileZones.NumCrss : + SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.NumFiles / + (double) SizeOfFileZones.NumCrss : 0.0); } if (SizeOfFileZones.NumUsrs == -1) @@ -4481,32 +4486,34 @@ static void Sta_WriteRowStatsExpTrees (Brw_FileBrowser_t FileZone,const char *Na { sprintf (StrNumUsrs,"%d",SizeOfFileZones.NumUsrs); sprintf (StrNumFoldersPerUsr,"%.1f", - SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.NumFolders / (double) SizeOfFileZones.NumUsrs : + SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.NumFolders / + (double) SizeOfFileZones.NumUsrs : 0.0); sprintf (StrNumFilesPerUsr,"%.1f", - SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.NumFiles / (double) SizeOfFileZones.NumUsrs : + SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.NumFiles / + (double) SizeOfFileZones.NumUsrs : 0.0); } fprintf (Gbl.F.Out,"" - "" + "" "%s" "" - "" + "" "%s" "" - "" + "" "%s" "" - "" + "" "%u" "" - "" + "" "%lu" "" - "" + "" "%lu" "" - "", + "", ClassData,StyleTableCell,NameOfFileZones, ClassData,StyleTableCell,StrNumCrss, ClassData,StyleTableCell,StrNumUsrs, @@ -4516,28 +4523,38 @@ static void Sta_WriteRowStatsExpTrees (Brw_FileBrowser_t FileZone,const char *Na ClassData,StyleTableCell); Str_WriteSizeInBytesFull ((double) SizeOfFileZones.Size); fprintf (Gbl.F.Out,"" - "%s" - "%s" - "", + "" + "%s" + "" + "" + "%s" + "" + "", ClassData,StyleTableCell,StrNumFoldersPerCrs, ClassData,StyleTableCell,StrNumFilesPerCrs, ClassData,StyleTableCell); if (SizeOfFileZones.NumCrss == -1) fprintf (Gbl.F.Out,"-"); else - Str_WriteSizeInBytesFull (SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.Size / (double) SizeOfFileZones.NumCrss : + Str_WriteSizeInBytesFull (SizeOfFileZones.NumCrss ? (double) SizeOfFileZones.Size / + (double) SizeOfFileZones.NumCrss : 0.0); fprintf (Gbl.F.Out,"" - "%s" - "%s" - "", + "" + "%s" + "" + "" + "%s" + "" + "", ClassData,StyleTableCell,StrNumFoldersPerUsr, ClassData,StyleTableCell,StrNumFilesPerUsr, ClassData,StyleTableCell); if (SizeOfFileZones.NumUsrs == -1) fprintf (Gbl.F.Out,"-"); else - Str_WriteSizeInBytesFull (SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.Size / (double) SizeOfFileZones.NumUsrs : + Str_WriteSizeInBytesFull (SizeOfFileZones.NumUsrs ? (double) SizeOfFileZones.Size / + (double) SizeOfFileZones.NumUsrs : 0.0); fprintf (Gbl.F.Out,"" ""); @@ -4792,9 +4809,15 @@ static void Sta_ShowOERs (void) Sta_GetNumberOfOERFromDB (Gbl.Scope.Current,License,NumFiles); fprintf (Gbl.F.Out,"" - "%s" - "%lu" - "%lu" + "" + "%s" + "" + "" + "%lu" + "" + "" + "%lu" + "" "", Txt_LICENSES[License], NumFiles[0], @@ -4936,10 +4959,18 @@ static void Sta_ShowAssignmentsStats (void) /***** Write number of assignments *****/ fprintf (Gbl.F.Out,"" - "%u" - "%u" - "%.2f" - "%u" + "" + "%u" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%u" + "" "", NumAssignments, NumCoursesWithAssignments, @@ -4969,6 +5000,8 @@ static void Sta_ShowTestsStats (void) extern const char *Txt_Total; Tst_AnswerType_t AnsType; struct Tst_Stats Stats; + char *StyleTableCell = " border-style:solid none none none;" + " border-width:1px;"; /***** Table start *****/ Lay_StartRoundFrameTable10 (NULL,2,NULL); @@ -5005,20 +5038,39 @@ static void Sta_ShowTestsStats (void) /***** Write number of assignments *****/ fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%u (%.1f%%)" - "%u" - "%.2f" - "%lu" - "%.2f" - "%.2f" - "%.2f" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u (%.1f%%)" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%lu" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" "", Txt_TST_STR_ANSWER_TYPES[AnsType], Stats.NumCoursesWithQuestions, Stats.NumCoursesWithPluggableQuestions, - Stats.NumCoursesWithQuestions ? (float) Stats.NumCoursesWithPluggableQuestions * 100.0 / (float) Stats.NumCoursesWithQuestions : + Stats.NumCoursesWithQuestions ? (float) Stats.NumCoursesWithPluggableQuestions * 100.0 / + (float) Stats.NumCoursesWithQuestions : 0.0, Stats.NumQsts, Stats.AvgQstsPerCourse, @@ -5034,27 +5086,46 @@ static void Sta_ShowTestsStats (void) /***** Write number of assignments *****/ fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%u (%.1f%%)" - "%u" - "%.2f" - "%lu" - "%.2f" - "%.2f" - "%.2f" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u (%.1f%%)" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%lu" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" "", - Txt_Total, - Stats.NumCoursesWithQuestions, - Stats.NumCoursesWithPluggableQuestions, - Stats.NumCoursesWithQuestions ? (float) Stats.NumCoursesWithPluggableQuestions * 100.0 / (float) Stats.NumCoursesWithQuestions : + StyleTableCell,Txt_Total, + StyleTableCell,Stats.NumCoursesWithQuestions, + StyleTableCell,Stats.NumCoursesWithPluggableQuestions, + Stats.NumCoursesWithQuestions ? (float) Stats.NumCoursesWithPluggableQuestions * 100.0 / + (float) Stats.NumCoursesWithQuestions : 0.0, - Stats.NumQsts, - Stats.AvgQstsPerCourse, - Stats.NumHits, - Stats.AvgHitsPerCourse, - Stats.AvgHitsPerQuestion, - Stats.AvgScorePerQuestion); + StyleTableCell,Stats.NumQsts, + StyleTableCell,Stats.AvgQstsPerCourse, + StyleTableCell,Stats.NumHits, + StyleTableCell,Stats.AvgHitsPerCourse, + StyleTableCell,Stats.AvgHitsPerQuestion, + StyleTableCell,Stats.AvgScorePerQuestion); /***** End table *****/ Lay_EndRoundFrameTable10 (); @@ -5111,11 +5182,21 @@ static void Sta_ShowNoticesStats (void) /***** Write number of notices *****/ fprintf (Gbl.F.Out,"" - "%u" - "%u" - "%u" - "%u" - "%u" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" "", NumNotices[Not_ACTIVE_NOTICE], NumNotices[Not_OBSOLETE_NOTICE], @@ -5171,18 +5252,38 @@ static void Sta_ShowMsgsStats (void) /***** Write number of messages *****/ fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%u" - "%u" - "-" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "-" + "" "" "" - "%s" - "%u" - "%u" - "%u" - "%u" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" "", Txt_MSGS_Sent, NumMsgsSentNotDeleted, @@ -5422,17 +5523,42 @@ static void Sta_WriteForumTitleAndStats (For_ForumType_t ForumType, /***** Write forum name and stats *****/ fprintf (Gbl.F.Out,"" - "" + "" "\"\"" "" - "%s%s" - "%u" - "%u" - "%u" - "%u" - "%.2f" - "%.2f" - "%.2f" + "" + "%s%s" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" "", Gbl.Prefs.IconsURL,Icon, ForumName1,ForumName2, @@ -5450,6 +5576,8 @@ static void Sta_WriteForumTotalStats (struct Sta_StatsForum *StatsForum) float NumThrsPerForum; float NumPostsPerThread; float NumPostsPerForum; + char *StyleTableCell = " border-style:solid none none none;" + " border-width:1px;"; /***** Compute number of threads per forum, number of posts per forum and number of posts per thread *****/ NumThrsPerForum = (StatsForum->NumForums ? (float) StatsForum->NumThreads / (float) StatsForum->NumForums : @@ -5461,20 +5589,42 @@ static void Sta_WriteForumTotalStats (struct Sta_StatsForum *StatsForum) /***** Write forum name and stats *****/ fprintf (Gbl.F.Out,"" - "" + "" + "" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" + "" + "%.2f" "" - "%s" - "%u" - "%u" - "%u" - "%u" - "%.2f" - "%.2f" - "%.2f" "", - Txt_Total, - StatsForum->NumForums,StatsForum->NumThreads,StatsForum->NumPosts,StatsForum->NumUsrsToBeNotifiedByEMail, - NumThrsPerForum,NumPostsPerThread,NumPostsPerForum); + StyleTableCell, + StyleTableCell,Txt_Total, + StyleTableCell,StatsForum->NumForums, + StyleTableCell,StatsForum->NumThreads, + StyleTableCell,StatsForum->NumPosts, + StyleTableCell,StatsForum->NumUsrsToBeNotifiedByEMail, + StyleTableCell,NumThrsPerForum, + StyleTableCell,NumPostsPerThread, + StyleTableCell,NumPostsPerForum); } /*****************************************************************************/ @@ -5522,11 +5672,21 @@ static void Sta_ShowSurveysStats (void) /***** Write number of surveys *****/ fprintf (Gbl.F.Out,"" - "%u" - "%u" - "%.2f" - "%.2f" - "%u" + "" + "%u" + "" + "" + "%u" + "" + "" + "%.2f" + "" + "" + "%.2f" + "" + "" + "%u" + "" "", NumSurveys, NumCoursesWithSurveys, @@ -5636,12 +5796,19 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void) Lan < Txt_NUM_LANGUAGES; Lan++) fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%5.2f%%" + "" + "%s" + "" + "" + "%u" + "" + "" + "%5.2f%%" + "" "", Txt_STR_LANG_NAME[Lan],NumUsrs[Lan], - NumUsrsTotal ? 100.0 * (float) NumUsrs[Lan] / (float) NumUsrsTotal : + NumUsrsTotal ? (float) NumUsrs[Lan] * 100.0 / + (float) NumUsrsTotal : 0); Lay_EndRoundFrameTable10 (); @@ -5741,15 +5908,20 @@ static void Sta_GetAndShowNumUsrsPerLayout (void) Layout < Lay_NUM_LAYOUTS; Layout++) fprintf (Gbl.F.Out,"" - "" + "" "\"%s\"" "" - "%u" - "%5.2f%%" + "" + "%u" + "" + "" + "%5.2f%%" + "" "", Gbl.Prefs.IconsURL,Lay_LayoutIcons[Layout],Txt_LAYOUT_NAMES[Layout], NumUsrs[Layout], - NumUsrsTotal ? 100.0 * (float) NumUsrs[Layout] / (float) NumUsrsTotal : + NumUsrsTotal ? (float) NumUsrs[Layout] * 100.0 / + (float) NumUsrsTotal : 0); Lay_EndRoundFrameTable10 (); @@ -5849,15 +6021,21 @@ static void Sta_GetAndShowNumUsrsPerTheme (void) Theme < The_NUM_THEMES; Theme++) fprintf (Gbl.F.Out,"" - "" - "\"%s\"" + "" + "\"%s\""" + "" + "" + "%u" + "" + "" + "%5.2f%%" "" - "%u" - "%5.2f%%" "", Gbl.Prefs.IconsURL,Cfg_ICON_FOLDER_THEMES,The_ThemeId[Theme],The_ThemeNames[Theme], NumUsrs[Theme], - NumUsrsTotal ? 100.0 * (float) NumUsrs[Theme] / (float) NumUsrsTotal : + NumUsrsTotal ? (float) NumUsrs[Theme] * 100.0 / + (float) NumUsrsTotal : 0); Lay_EndRoundFrameTable10 (); @@ -5954,15 +6132,21 @@ static void Sta_GetAndShowNumUsrsPerColumns (void) SideCols <= 3; SideCols++) fprintf (Gbl.F.Out,"" - "" - "\"%s\"" + "" + "\"%s\""" + "" + "" + "%u" + "" + "" + "%5.2f%%" "" - "%u" - "%5.2f%%" "", Gbl.Prefs.IconsURL,SideCols >> 1,SideCols & 1,Txt_LAYOUT_SIDE_COLUMNS[SideCols], NumUsrs[SideCols], - NumUsrsTotal ? 100.0 * (float) NumUsrs[SideCols] / (float) NumUsrsTotal : + NumUsrsTotal ? (float) NumUsrs[SideCols] * 100.0 / + (float) NumUsrsTotal : 0); Lay_EndRoundFrameTable10 (); @@ -6061,11 +6245,16 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void) IconSet < Ico_NUM_ICON_SETS; IconSet++) fprintf (Gbl.F.Out,"" - "" - "\"%s\"" + "" + "\"%s\""" + "" + "" + "%u" + "" + "" + "%5.2f%%" "" - "%u" - "%5.2f%%" "", Gbl.Prefs.IconsURL, Cfg_ICON_FOLDER_ICON_SETS, @@ -6073,7 +6262,8 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void) Cfg_ICON_ACTION_32x32, Ico_IconSetNames[IconSet], NumUsrs[IconSet], - NumUsrsTotal ? 100.0 * (float) NumUsrs[IconSet] / (float) NumUsrsTotal : + NumUsrsTotal ? (float) NumUsrs[IconSet] * 100.0 / + (float) NumUsrsTotal : 0); Lay_EndRoundFrameTable10 (); @@ -6103,6 +6293,8 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void) unsigned NumEvents[Ntf_NUM_NOTIFY_EVENTS]; unsigned NumMailsTotal = 0; unsigned NumMails[Ntf_NUM_NOTIFY_EVENTS]; + char *StyleTableCell = " border-style:solid none none none;" + " border-width:1px;"; Lay_StartRoundFrameTable10 (NULL,2,NULL); @@ -6308,33 +6500,55 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void) NotifyEvent < Ntf_NUM_NOTIFY_EVENTS; NotifyEvent++) // 0 is reserved for Ntf_EVENT_UNKNOWN fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%5.2f%%" - "%u" - "%u" + "" + "%s" + "" + "" + "%u" + "" + "" + "%5.2f%%" + "" + "" + "%u" + "" + "" + "%u" + "" "", Txt_NOTIFY_EVENTS_PLURAL[NotifyEvent], NumUsrs[NotifyEvent], - NumUsrsTotalInPlatform ? 100.0 * (float) NumUsrs[NotifyEvent] / (float) NumUsrsTotalInPlatform : + NumUsrsTotalInPlatform ? (float) NumUsrs[NotifyEvent] * 100.0 / + (float) NumUsrsTotalInPlatform : 0.0, NumEvents[NotifyEvent], NumMails[NotifyEvent]); /***** Write total number of users who want to be notified by e-mail on some event *****/ fprintf (Gbl.F.Out,"" - "%s" - "%u" - "%5.2f%%" - "%u" - "%u" + "" + "%s" + "" + "" + "%u" + "" + "" + "%5.2f%%" + "" + "" + "%u" + "" + "" + "%u" + "" "", - Txt_Total, - NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent, - NumUsrsTotalInPlatform ? 100.0 * (float) NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent / (float) NumUsrsTotalInPlatform : - 0.0, - NumEventsTotal, - NumMailsTotal); + StyleTableCell,Txt_Total, + StyleTableCell,NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent, + StyleTableCell,NumUsrsTotalInPlatform ? (float) NumUsrsTotalWhoWantToBeNotifiedByEMailAboutSomeEvent * 100.0 / + (float) NumUsrsTotalInPlatform : + 0.0, + StyleTableCell,NumEventsTotal, + StyleTableCell,NumMailsTotal); Lay_EndRoundFrameTable10 (); }