Version19.209.3

This commit is contained in:
acanas 2020-05-01 23:36:30 +02:00
parent 5a013f2ab3
commit d6206198ba
4 changed files with 29 additions and 13 deletions

View File

@ -544,10 +544,15 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.209.1 (2020-05-01)"
#define Log_PLATFORM_VERSION "SWAD 19.209.3 (2020-05-01)"
#define CSS_FILE "swad19.193.1.css"
#define JS_FILE "swad19.193.1.js"
/*
Version 19.209.3: May 01, 2020 More figures cached. (300750 lines)
1 change necessary in database:
DELETE FROM figures;
Version 19.209.2: May 01, 2020 Fixed bug in figures cached. (300737 lines)
Version 19.209.1: May 01, 2020 Fixed bug in figures cached. (? lines)
Version 19.209: May 01, 2020 More figures cached. (300734 lines)
3 changes necessary in database:

View File

@ -540,6 +540,7 @@ static void Fig_GetAndShowNumUsrsInCrss (Rol_Role_t Role)
static void Fig_GetAndShowNumUsrsNotBelongingToAnyCrs (void)
{
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
unsigned NumGsts;
char *Class = "DAT RB";
/***** Write the total number of users not belonging to any course *****/
@ -550,7 +551,15 @@ static void Fig_GetAndShowNumUsrsNotBelongingToAnyCrs (void)
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s\"",Class);
HTM_Unsigned (Usr_GetNumUsrsNotBelongingToAnyCrs ());
if (!FigCch_GetFigureFromCache (FigCch_NUM_GSTS,Hie_SYS,-1L,
FigCch_Type_UNSIGNED,&NumGsts))
{
// Not updated recently in cache ==> compute and update it in cache
NumGsts = Usr_GetNumUsrsNotBelongingToAnyCrs ();
FigCch_UpdateFigureIntoCache (FigCch_NUM_GSTS,Hie_SYS,-1L,
FigCch_Type_UNSIGNED,&NumGsts);
}
HTM_Unsigned (NumGsts);
HTM_TD_End ();
HTM_TD_Begin ("class=\"%s\"",Class);

View File

@ -25,10 +25,7 @@
/********************************* Headers ***********************************/
/*****************************************************************************/
//#define _GNU_SOURCE // For asprintf
#include <stdio.h> // For sscanf
//#include <stdlib.h> // For system, getenv, etc.
//#include <string.h> // For string functions
#include "swad_database.h"
#include "swad_figure_cache.h"
@ -83,6 +80,7 @@ void FigCch_UpdateFigureIntoCache (FigCch_FigureCached_t Figure,
*((unsigned *) ValuePtr));
break;
case FigCch_Type_DOUBLE:
Str_SetDecimalPointToUS (); // To write the decimal point as a dot
DB_QueryREPLACE ("can not update cached figure value",
"REPLACE INTO figures"
" (Figure,Scope,Cod,ValueInt,ValueDouble)"
@ -90,6 +88,7 @@ void FigCch_UpdateFigureIntoCache (FigCch_FigureCached_t Figure,
" (%u,'%s',%ld,0,'%.15lg')",
(unsigned) Figure,Sco_GetDBStrFromScope (Scope),Cod,
*((double *) ValuePtr));
Str_SetDecimalPointToLocal (); // Return to local system
break;
}
}
@ -150,8 +149,10 @@ bool FigCch_GetFigureFromCache (FigCch_FigureCached_t Figure,
Found = true;
break;
case FigCch_Type_DOUBLE:
Str_SetDecimalPointToUS (); // To write the decimal point as a dot
if (sscanf (row[0],"%lf",(double *) ValuePtr) == 1)
Found = true;
Str_SetDecimalPointToLocal (); // Return to local system
break;
}
}

View File

@ -51,16 +51,17 @@ typedef enum
FigCch_NUM_NETS_IN_CRSS = 8, // Number of non-editing teachers in courses
FigCch_NUM_TCHS_IN_CRSS = 9, // Number of teachers in courses
FigCch_NUM_USRS_IN_CRSS = 10, // Number of users in courses
FigCch_NUM_GSTS = 11, // Number of guests (users not belonging to any course)
//--------------------------------------------------------------------------
FigCch_NUM_CRSS_PER_USR = 11, // Number of courses per user
FigCch_NUM_CRSS_PER_STD = 12, // Number of courses per student
FigCch_NUM_CRSS_PER_NET = 13, // Number of courses per non-editing teacher
FigCch_NUM_CRSS_PER_TCH = 14, // Number of courses per teacher
FigCch_NUM_CRSS_PER_USR = 12, // Number of courses per user
FigCch_NUM_CRSS_PER_STD = 13, // Number of courses per student
FigCch_NUM_CRSS_PER_NET = 14, // Number of courses per non-editing teacher
FigCch_NUM_CRSS_PER_TCH = 15, // Number of courses per teacher
//--------------------------------------------------------------------------
FigCch_NUM_USRS_PER_CRS = 15, // Number of users per course
FigCch_NUM_STDS_PER_CRS = 16, // Number of students per course
FigCch_NUM_NETS_PER_CRS = 17, // Number of non-editing teachers per course
FigCch_NUM_TCHS_PER_CRS = 18, // Number of teachers per course
FigCch_NUM_USRS_PER_CRS = 16, // Number of users per course
FigCch_NUM_STDS_PER_CRS = 17, // Number of students per course
FigCch_NUM_NETS_PER_CRS = 18, // Number of non-editing teachers per course
FigCch_NUM_TCHS_PER_CRS = 19, // Number of teachers per course
} FigCch_FigureCached_t;
#define FigCch_NUM_TYPES 2