Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed.

This commit is contained in:
acanas 2021-03-26 00:07:21 +01:00
parent 570ac36de1
commit 01219db411
4 changed files with 19 additions and 14 deletions

View File

@ -1,9 +1,9 @@
CREATE DATABASE IF NOT EXISTS swad DEFAULT CHARACTER SET=latin1 DEFAULT COLLATE latin1_spanish_ci; CREATE DATABASE IF NOT EXISTS swad DEFAULT CHARACTER SET=latin1 DEFAULT COLLATE latin1_spanish_ci;
USE swad; USE swad;
-- --
-- Table act_MFU: stores the recent actions more frequently made by each user -- Table act_frequent: stores the recent actions more frequently made by each user
-- --
CREATE TABLE IF NOT EXISTS act_MFU ( CREATE TABLE IF NOT EXISTS act_frequent (
UsrCod INT NOT NULL, UsrCod INT NOT NULL,
ActCod INT NOT NULL, ActCod INT NOT NULL,
Score FLOAT NOT NULL, Score FLOAT NOT NULL,

View File

@ -111,7 +111,7 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc
/***** Get most frequently used actions *****/ /***** Get most frequently used actions *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not get most frequently used actions", NumRows = DB_QuerySELECT (&mysql_res,"can not get most frequently used actions",
"SELECT ActCod" // row[0] "SELECT ActCod" // row[0]
" FROM act_MFU" " FROM act_frequent"
" WHERE UsrCod=%ld" " WHERE UsrCod=%ld"
" ORDER BY Score DESC," " ORDER BY Score DESC,"
"LastClick DESC", "LastClick DESC",
@ -158,7 +158,7 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
NumActions = (unsigned) NumActions = (unsigned)
DB_QuerySELECT (&mysql_res,"can not get the most frequently used actions", DB_QuerySELECT (&mysql_res,"can not get the most frequently used actions",
"SELECT ActCod" // row[0] "SELECT ActCod" // row[0]
" FROM act_MFU" " FROM act_frequent"
" WHERE UsrCod=%ld" " WHERE UsrCod=%ld"
" ORDER BY LastClick DESC," " ORDER BY LastClick DESC,"
"Score DESC", "Score DESC",
@ -354,9 +354,9 @@ void MFU_UpdateMFUActions (void)
/***** Get current score *****/ /***** Get current score *****/
if (DB_QuerySELECT (&mysql_res,"can not get score for current action", if (DB_QuerySELECT (&mysql_res,"can not get score for current action",
"SELECT Score" // row[0] "SELECT Score" // row[0]
" FROM act_MFU" " FROM act_frequent"
" WHERE UsrCod=%ld" " WHERE UsrCod=%ld"
" AND ActCod=%ld", " AND ActCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,
ActCod)) ActCod))
{ {
@ -375,7 +375,7 @@ void MFU_UpdateMFUActions (void)
/***** Update score for the current action *****/ /***** Update score for the current action *****/
DB_QueryREPLACE ("can not update most frequently used actions", DB_QueryREPLACE ("can not update most frequently used actions",
"REPLACE INTO act_MFU" "REPLACE INTO act_frequent"
" (UsrCod,ActCod,Score,LastClick)" " (UsrCod,ActCod,Score,LastClick)"
" VALUES" " VALUES"
" (%ld,%ld,'%15lg',NOW())", " (%ld,%ld,'%15lg',NOW())",
@ -383,9 +383,10 @@ void MFU_UpdateMFUActions (void)
/***** Update score for other actions *****/ /***** Update score for other actions *****/
DB_QueryUPDATE ("can not update most frequently used actions", DB_QueryUPDATE ("can not update most frequently used actions",
"UPDATE act_MFU" "UPDATE act_frequent"
" SET Score=GREATEST(Score*'%.15lg','%.15lg')" " SET Score=GREATEST(Score*'%.15lg','%.15lg')"
" WHERE UsrCod=%ld AND ActCod<>%ld", " WHERE UsrCod=%ld"
" AND ActCod<>%ld",
MFU_DECREASE_FACTOR,MFU_MIN_SCORE, MFU_DECREASE_FACTOR,MFU_MIN_SCORE,
Gbl.Usrs.Me.UsrDat.UsrCod,ActCod); Gbl.Usrs.Me.UsrDat.UsrCod,ActCod);

View File

@ -600,13 +600,17 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria. TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/ */
#define Log_PLATFORM_VERSION "SWAD 20.51.46 (2021-03-26)" #define Log_PLATFORM_VERSION "SWAD 20.51.47 (2021-03-26)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js" #define JS_FILE "swad20.6.2.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.51.47: Mar 26, 2021 Most frequent actions database table renamed. (308779 lines)
1 change necessary in database:
RENAME TABLE act_MFU TO act_frequent;
Version 20.51.46: Mar 26, 2021 User reports database table renamed. (308775 lines) Version 20.51.46: Mar 26, 2021 User reports database table renamed. (308775 lines)
1 change necessary in database: 1 change necessary in database:
RENAME TABLE usr_report TO usr_reports; RENAME TABLE usr_report TO usr_reports;

View File

@ -92,9 +92,9 @@ void DB_CreateTablesIfNotExist (void)
Ale_ShowAlert (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist); Ale_ShowAlert (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist);
HTM_OL_Begin (); HTM_OL_Begin ();
/***** Table act_MFU *****/ /***** Table act_frequent *****/
/* /*
mysql> DESCRIBE act_MFU; mysql> DESCRIBE act_frequent;
+-----------+----------+------+-----+---------+-------+ +-----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
+-----------+----------+------+-----+---------+-------+ +-----------+----------+------+-----+---------+-------+
@ -105,7 +105,7 @@ mysql> DESCRIBE act_MFU;
+-----------+----------+------+-----+---------+-------+ +-----------+----------+------+-----+---------+-------+
4 rows in set (0.01 sec) 4 rows in set (0.01 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_MFU (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS act_frequent ("
"UsrCod INT NOT NULL," "UsrCod INT NOT NULL,"
"ActCod INT NOT NULL," "ActCod INT NOT NULL,"
"Score FLOAT NOT NULL," "Score FLOAT NOT NULL,"