From 77014a0cb112a0a28cff69c90802c08604525e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 9 Jun 2016 14:00:10 +0200 Subject: [PATCH] Version 15.222.1 --- swad_changelog.h | 3 +- swad_indicator.c | 670 ++++++++++++++++++++++++----------------------- swad_indicator.h | 3 - 3 files changed, 341 insertions(+), 335 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index bf67d70b0..739879360 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -135,13 +135,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.222 (2016-06-09)" +#define Log_PLATFORM_VERSION "SWAD 15.222.1 (2016-06-09)" #define CSS_FILE "swad15.218.css" #define JS_FILE "swad15.216.js" // 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 sql/swad*.sql | tail -1 /* + Version 15.222.1: Jun 09, 2016 Optimization in number of indicators. (202230 lines) Version 15.222: Jun 09, 2016 Number of indicators is stored in table of courses. (202224 lines) Version 15.221.4: Jun 09, 2016 New columns in table of courses to store number of indicators. (202153 lines) 1 change necessary in database: diff --git a/swad_indicator.c b/swad_indicator.c index a20f180dd..f867087bc 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -71,7 +71,10 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 unsigned NumCrss,bool PutForm); static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, unsigned NumCrss,MYSQL_RES *mysql_res); -static void Ind_StoreIndicatorsCrs (long CrsCod,unsigned NumIndicators); +static int Ind_GetNumIndicatorsCrsFromDB (long CrsCod); +static void Ind_StoreIndicatorsCrsIntoDB (long CrsCod,unsigned NumIndicators); +static void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, + struct Ind_IndicatorsCrs *Indicators); static unsigned long Ind_GetNumFilesInDocumZonesOfCrsFromDB (long CrsCod); static unsigned long Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod); static unsigned long Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod); @@ -705,7 +708,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat long CrsCod; unsigned NumTchs; unsigned NumStds; - int NumIndicatorsFromDB; + unsigned NumIndicators; struct Ind_IndicatorsCrs Indicators; /***** Table start *****/ @@ -985,358 +988,363 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat if ((CrsCod = Str_ConvertStrCodToLongCod (row[2])) < 0) Lay_ShowErrorAndExit ("Wrong code of course."); - /* Compute indicators of this course */ - NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (CrsCod); - Ind_ComputeAndStoreIndicatorsCrs (CrsCod,NumIndicatorsFromDB,&Indicators); + /* Get stored number of indicators of this course */ + NumIndicators = Ind_GetAndUpdateNumIndicatorsCrs (CrsCod); + if (Gbl.Stat.IndicatorsSelected[NumIndicators]) + { + /* Compute and store indicators */ + Ind_ComputeAndStoreIndicatorsCrs (CrsCod,(int) NumIndicators,&Indicators); - if (Gbl.Stat.IndicatorsSelected[Indicators.CountIndicators]) - { - /* Write a row for this course */ - switch (IndicatorsLayout) - { - case Ind_INDICATORS_BRIEF: - fprintf (Gbl.F.Out,"" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "" - "%s/?crs=%ld&act=%ld" - "" - "" + /* The number of indicators may have changed */ + if (Gbl.Stat.IndicatorsSelected[Indicators.CountIndicators]) + { + /* Write a row for this course */ + switch (IndicatorsLayout) + { + case Ind_INDICATORS_BRIEF: + fprintf (Gbl.F.Out,"" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "" + "" + "%s/?crs=%ld&act=%ld" + "" + "" - "" - "%u" - "" + "" + "%u" + "" - "" - "%s" - "" - "" - "%s" - "" + "" + "%s" + "" + "" + "%s" + "" - "" - "%s" - "" - "" - "%s" - "" + "" + "%s" + "" + "" + "%s" + "" - "" - "%s" - "" - "" - "%s" - "" + "" + "%s" + "" + "" + "%s" + "" - "" - "%s" - "" - "" - "%s" - "" + "" + "%s" + "" + "" + "%s" + "" - "" - "%s" - "" - "" - "%s" - "" - "", - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[0], - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[1], - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[3], - Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + "" + "%s" + "" + "" + "%s" + "" + "", + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[0], + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[1], + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[3], + Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - Indicators.CountIndicators, + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + Indicators.CountIndicators, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsSyllabus ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsSyllabus ? "" : - Txt_NO, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsSyllabus ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsSyllabus ? "" : + Txt_NO, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereAreAssignments ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereAreAssignments ? "" : - Txt_NO, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereAreAssignments ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereAreAssignments ? "" : + Txt_NO, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsOnlineTutoring ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsOnlineTutoring ? "" : - Txt_NO, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsOnlineTutoring ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsOnlineTutoring ? "" : + Txt_NO, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereAreMaterials ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereAreMaterials ? "" : - Txt_NO, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereAreMaterials ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereAreMaterials ? "" : + Txt_NO, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsAssessment ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsAssessment ? "" : - Txt_NO); - break; - case Ind_INDICATORS_FULL: - /* Get number of users */ - NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod); - NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod); + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsAssessment ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsAssessment ? "" : + Txt_NO); + break; + case Ind_INDICATORS_FULL: + /* Get number of users */ + NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod); + NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod); - fprintf (Gbl.F.Out,"" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "" - "%s/?crs=%ld&act=%ld" - "" - "" + fprintf (Gbl.F.Out,"" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "" + "" + "%s/?crs=%ld&act=%ld" + "" + "" - "" - "%u" - "" - "" - "%u" - "" + "" + "%u" + "" + "" + "%u" + "" - "" - "%u" - "" + "" + "%u" + "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%u" - "" - "" - "%lu" - "" - "" - "%lu" - "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%u" + "" + "" + "%lu" + "" + "" + "%lu" + "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%u" - "" - "" - "%u" - "" - "" - "%u" - "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%u" + "" + "" + "%u" + "" + "" + "%u" + "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%lu" - "" - "" - "%lu" - "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%lu" + "" + "" + "%lu" + "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "", - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[0], - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[1], - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - row[3], - Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "", + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[0], + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[1], + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + row[3], + Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - NumTchs != 0 ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - NumTchs, - NumStds != 0 ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - NumStds, + NumTchs != 0 ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + NumTchs, + NumStds != 0 ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + NumStds, - Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : - (Indicators.CoursePartiallyOK ? "DAT_SMALL" : - "DAT_SMALL_RED"), - Gbl.RowEvenOdd, - Indicators.CountIndicators, + Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : + (Indicators.CoursePartiallyOK ? "DAT_SMALL" : + "DAT_SMALL_RED"), + Gbl.RowEvenOdd, + Indicators.CountIndicators, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsSyllabus ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsSyllabus ? "" : - Txt_NO, - (Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc], - (Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc], - (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc], + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsSyllabus ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsSyllabus ? "" : + Txt_NO, + (Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc], + (Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc], + (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc], - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereAreAssignments ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereAreAssignments ? "" : - Txt_NO, - (Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumAssignments, - (Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumFilesAssignments, - (Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumFilesWorks, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereAreAssignments ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereAreAssignments ? "" : + Txt_NO, + (Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumAssignments, + (Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumFilesAssignments, + (Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumFilesWorks, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsOnlineTutoring ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsOnlineTutoring ? "" : - Txt_NO, - (Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumThreads, - (Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumPosts, - (Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumMsgsSentByTchs, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsOnlineTutoring ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsOnlineTutoring ? "" : + Txt_NO, + (Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumThreads, + (Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumPosts, + (Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumMsgsSentByTchs, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereAreMaterials ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereAreMaterials ? "" : - Txt_NO, - (Indicators.NumFilesInDocumentZones != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumFilesInDocumentZones, - (Indicators.NumFilesInSharedZones != 0) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Indicators.NumFilesInSharedZones, + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereAreMaterials ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereAreMaterials ? "" : + Txt_NO, + (Indicators.NumFilesInDocumentZones != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumFilesInDocumentZones, + (Indicators.NumFilesInSharedZones != 0) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Indicators.NumFilesInSharedZones, - "DAT_SMALL_GREEN",Gbl.RowEvenOdd, - Indicators.ThereIsAssessment ? Txt_YES : - "", - "DAT_SMALL_RED",Gbl.RowEvenOdd, - Indicators.ThereIsAssessment ? "" : - Txt_NO, - (Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc], - (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : - "DAT_SMALL_RED", - Gbl.RowEvenOdd, - Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]); - break; - } - } + "DAT_SMALL_GREEN",Gbl.RowEvenOdd, + Indicators.ThereIsAssessment ? Txt_YES : + "", + "DAT_SMALL_RED",Gbl.RowEvenOdd, + Indicators.ThereIsAssessment ? "" : + Txt_NO, + (Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc], + (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED", + Gbl.RowEvenOdd, + Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]); + break; + } + } + } } /***** End table *****/ @@ -1370,7 +1378,7 @@ unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod) /************ Get number of indicators of a course from database *************/ /*****************************************************************************/ -int Ind_GetNumIndicatorsCrsFromDB (long CrsCod) +static int Ind_GetNumIndicatorsCrsFromDB (long CrsCod) { char Query[128]; MYSQL_RES *mysql_res; @@ -1400,7 +1408,7 @@ int Ind_GetNumIndicatorsCrsFromDB (long CrsCod) /************ Store number of indicators of a course in database *************/ /*****************************************************************************/ -static void Ind_StoreIndicatorsCrs (long CrsCod,unsigned NumIndicators) +static void Ind_StoreIndicatorsCrsIntoDB (long CrsCod,unsigned NumIndicators) { char Query[128]; @@ -1416,8 +1424,8 @@ static void Ind_StoreIndicatorsCrs (long CrsCod,unsigned NumIndicators) /* If number of indicators stored in database is different from number of indicators just computed ==> update it into database */ -void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, - struct Ind_IndicatorsCrs *Indicators) +static void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, + struct Ind_IndicatorsCrs *Indicators) { /***** Initialize number of indicators *****/ Indicators->CountIndicators = 0; @@ -1477,7 +1485,7 @@ void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, /***** Update number of indicators into database if different to the stored one *****/ if (NumIndicatorsFromDB != (int) Indicators->CountIndicators) - Ind_StoreIndicatorsCrs (CrsCod,Indicators->CountIndicators); + Ind_StoreIndicatorsCrsIntoDB (CrsCod,Indicators->CountIndicators); } /*****************************************************************************/ diff --git a/swad_indicator.h b/swad_indicator.h index 49aaae125..914d69a47 100644 --- a/swad_indicator.h +++ b/swad_indicator.h @@ -66,8 +66,5 @@ struct Ind_IndicatorsCrs void Ind_ReqIndicatorsCourses (void); void Ind_ShowIndicatorsCourses (void); unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod); -int Ind_GetNumIndicatorsCrsFromDB (long CrsCod); -void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, - struct Ind_IndicatorsCrs *Indicators); #endif