Version 15.222.1

This commit is contained in:
Antonio Cañas Vargas 2016-06-09 14:00:10 +02:00
parent d823690c63
commit 77014a0cb1
3 changed files with 341 additions and 335 deletions

View File

@ -135,13 +135,14 @@
/****************************** Public constants *****************************/ /****************************** 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 CSS_FILE "swad15.218.css"
#define JS_FILE "swad15.216.js" #define JS_FILE "swad15.216.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // 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.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) 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: 1 change necessary in database:

View File

@ -71,7 +71,10 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
unsigned NumCrss,bool PutForm); unsigned NumCrss,bool PutForm);
static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout,
unsigned NumCrss,MYSQL_RES *mysql_res); 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_GetNumFilesInDocumZonesOfCrsFromDB (long CrsCod);
static unsigned long Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod); static unsigned long Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod);
static unsigned long Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod); static unsigned long Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod);
@ -705,7 +708,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
long CrsCod; long CrsCod;
unsigned NumTchs; unsigned NumTchs;
unsigned NumStds; unsigned NumStds;
int NumIndicatorsFromDB; unsigned NumIndicators;
struct Ind_IndicatorsCrs Indicators; struct Ind_IndicatorsCrs Indicators;
/***** Table start *****/ /***** Table start *****/
@ -985,358 +988,363 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
if ((CrsCod = Str_ConvertStrCodToLongCod (row[2])) < 0) if ((CrsCod = Str_ConvertStrCodToLongCod (row[2])) < 0)
Lay_ShowErrorAndExit ("Wrong code of course."); Lay_ShowErrorAndExit ("Wrong code of course.");
/* Compute indicators of this course */ /* Get stored number of indicators of this course */
NumIndicatorsFromDB = Ind_GetNumIndicatorsCrsFromDB (CrsCod); NumIndicators = Ind_GetAndUpdateNumIndicatorsCrs (CrsCod);
Ind_ComputeAndStoreIndicatorsCrs (CrsCod,NumIndicatorsFromDB,&Indicators); if (Gbl.Stat.IndicatorsSelected[NumIndicators])
{
/* Compute and store indicators */
Ind_ComputeAndStoreIndicatorsCrs (CrsCod,(int) NumIndicators,&Indicators);
if (Gbl.Stat.IndicatorsSelected[Indicators.CountIndicators]) /* The number of indicators may have changed */
{ if (Gbl.Stat.IndicatorsSelected[Indicators.CountIndicators])
/* Write a row for this course */ {
switch (IndicatorsLayout) /* Write a row for this course */
{ switch (IndicatorsLayout)
case Ind_INDICATORS_BRIEF: {
fprintf (Gbl.F.Out,"<tr>" case Ind_INDICATORS_BRIEF:
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" fprintf (Gbl.F.Out,"<tr>"
"%s" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"</td>" "%s"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "</td>"
"%s" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"</td>" "%s"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "</td>"
"%s" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"</td>" "%s"
"<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">" "</td>"
"<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">" "<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">"
"%s/?crs=%ld&amp;act=%ld" "<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">"
"</a>" "%s/?crs=%ld&amp;act=%ld"
"</td>" "</a>"
"</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[0], row[0],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[1], row[1],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[3], row[3],
Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod,
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.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.CountIndicators, Indicators.CountIndicators,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? Txt_YES : Indicators.ThereIsSyllabus ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? "" : Indicators.ThereIsSyllabus ? "" :
Txt_NO, Txt_NO,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? Txt_YES : Indicators.ThereAreAssignments ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? "" : Indicators.ThereAreAssignments ? "" :
Txt_NO, Txt_NO,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? Txt_YES : Indicators.ThereIsOnlineTutoring ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? "" : Indicators.ThereIsOnlineTutoring ? "" :
Txt_NO, Txt_NO,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? Txt_YES : Indicators.ThereAreMaterials ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? "" : Indicators.ThereAreMaterials ? "" :
Txt_NO, Txt_NO,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? Txt_YES : Indicators.ThereIsAssessment ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? "" : Indicators.ThereIsAssessment ? "" :
Txt_NO); Txt_NO);
break; break;
case Ind_INDICATORS_FULL: case Ind_INDICATORS_FULL:
/* Get number of users */ /* Get number of users */
NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod); NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod);
NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod); NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod);
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">" "<td class=\"DAT_SMALL LEFT_MIDDLE COLOR%u\">"
"<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">" "<a href=\"%s/?crs=%ld&amp;act=%ld\" target=\"_blank\">"
"%s/?crs=%ld&amp;act=%ld" "%s/?crs=%ld&amp;act=%ld"
"</a>" "</a>"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%u" "%u"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s RIGHT_MIDDLE COLOR%u\">" "<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
"%lu" "%lu"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s CENTER_MIDDLE COLOR%u\">" "<td class=\"%s CENTER_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"<td class=\"%s LEFT_MIDDLE COLOR%u\">" "<td class=\"%s LEFT_MIDDLE COLOR%u\">"
"%s" "%s"
"</td>" "</td>"
"</tr>", "</tr>",
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[0], row[0],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[1], row[1],
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[3], row[3],
Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Gbl.RowEvenOdd,Cfg_HTTPS_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod,
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" : NumTchs != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
NumTchs, NumTchs,
NumStds != 0 ? "DAT_SMALL_GREEN" : NumStds != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
NumStds, NumStds,
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.CountIndicators, Indicators.CountIndicators,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? Txt_YES : Indicators.ThereIsSyllabus ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsSyllabus ? "" : Indicators.ThereIsSyllabus ? "" :
Txt_NO, Txt_NO,
(Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusLecSrc],
(Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.SyllabusPraSrc],
(Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc],
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? Txt_YES : Indicators.ThereAreAssignments ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreAssignments ? "" : Indicators.ThereAreAssignments ? "" :
Txt_NO, Txt_NO,
(Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumAssignments, Indicators.NumAssignments,
(Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesAssignments != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumFilesAssignments, Indicators.NumFilesAssignments,
(Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesWorks != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumFilesWorks, Indicators.NumFilesWorks,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? Txt_YES : Indicators.ThereIsOnlineTutoring ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsOnlineTutoring ? "" : Indicators.ThereIsOnlineTutoring ? "" :
Txt_NO, Txt_NO,
(Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumThreads != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumThreads, Indicators.NumThreads,
(Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumPosts != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumPosts, Indicators.NumPosts,
(Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumMsgsSentByTchs != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumMsgsSentByTchs, Indicators.NumMsgsSentByTchs,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? Txt_YES : Indicators.ThereAreMaterials ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereAreMaterials ? "" : Indicators.ThereAreMaterials ? "" :
Txt_NO, Txt_NO,
(Indicators.NumFilesInDocumentZones != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesInDocumentZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumFilesInDocumentZones, Indicators.NumFilesInDocumentZones,
(Indicators.NumFilesInSharedZones != 0) ? "DAT_SMALL_GREEN" : (Indicators.NumFilesInSharedZones != 0) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Indicators.NumFilesInSharedZones, Indicators.NumFilesInSharedZones,
"DAT_SMALL_GREEN",Gbl.RowEvenOdd, "DAT_SMALL_GREEN",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? Txt_YES : Indicators.ThereIsAssessment ? Txt_YES :
"", "",
"DAT_SMALL_RED",Gbl.RowEvenOdd, "DAT_SMALL_RED",Gbl.RowEvenOdd,
Indicators.ThereIsAssessment ? "" : Indicators.ThereIsAssessment ? "" :
Txt_NO, Txt_NO,
(Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc], Txt_INFO_SRC_SHORT_TEXT[Indicators.AssessmentSrc],
(Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (Indicators.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]); Txt_INFO_SRC_SHORT_TEXT[Indicators.TeachingGuideSrc]);
break; break;
} }
} }
}
} }
/***** End table *****/ /***** End table *****/
@ -1370,7 +1378,7 @@ unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod)
/************ Get number of indicators of a course from database *************/ /************ Get number of indicators of a course from database *************/
/*****************************************************************************/ /*****************************************************************************/
int Ind_GetNumIndicatorsCrsFromDB (long CrsCod) static int Ind_GetNumIndicatorsCrsFromDB (long CrsCod)
{ {
char Query[128]; char Query[128];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -1400,7 +1408,7 @@ int Ind_GetNumIndicatorsCrsFromDB (long CrsCod)
/************ Store number of indicators of a course in database *************/ /************ 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]; char Query[128];
@ -1416,8 +1424,8 @@ static void Ind_StoreIndicatorsCrs (long CrsCod,unsigned NumIndicators)
/* If number of indicators stored in database is different /* If number of indicators stored in database is different
from number of indicators just computed ==> update it into database */ from number of indicators just computed ==> update it into database */
void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, static void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
struct Ind_IndicatorsCrs *Indicators) struct Ind_IndicatorsCrs *Indicators)
{ {
/***** Initialize number of indicators *****/ /***** Initialize number of indicators *****/
Indicators->CountIndicators = 0; Indicators->CountIndicators = 0;
@ -1477,7 +1485,7 @@ void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
/***** Update number of indicators into database /***** Update number of indicators into database
if different to the stored one *****/ if different to the stored one *****/
if (NumIndicatorsFromDB != (int) Indicators->CountIndicators) if (NumIndicatorsFromDB != (int) Indicators->CountIndicators)
Ind_StoreIndicatorsCrs (CrsCod,Indicators->CountIndicators); Ind_StoreIndicatorsCrsIntoDB (CrsCod,Indicators->CountIndicators);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -66,8 +66,5 @@ struct Ind_IndicatorsCrs
void Ind_ReqIndicatorsCourses (void); void Ind_ReqIndicatorsCourses (void);
void Ind_ShowIndicatorsCourses (void); void Ind_ShowIndicatorsCourses (void);
unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod); unsigned Ind_GetAndUpdateNumIndicatorsCrs (long CrsCod);
int Ind_GetNumIndicatorsCrsFromDB (long CrsCod);
void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
struct Ind_IndicatorsCrs *Indicators);
#endif #endif