Version19.30

This commit is contained in:
Antonio Cañas Vargas 2019-10-01 21:18:53 +02:00
parent 2891796a96
commit ec2465e84c
5 changed files with 39 additions and 40 deletions

View File

@ -623,7 +623,7 @@ function readLastClicksData () {
// This function must be called from time to time
var objXMLHttpReqNewTL = false;
function refreshNewTimeline () {
function refreshNewTL () {
objXMLHttpReqNewTL = AJAXCreateObject();
if (objXMLHttpReqNewTL) {
var RefreshParams = RefreshParamNxtActNewPub + '&' +
@ -672,8 +672,8 @@ function readNewTimelineData () {
}
// Global delay variable is set initially in swad-core
delayNewTimeline += 1000; // Increase 1 second
setTimeout('refreshNewTimeline()',delayNewTimeline);
delayNewTL += 1000; // Increase 1 second
setTimeout('refreshNewTL()',delayNewTL);
}
}
}

View File

@ -483,12 +483,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.29 (2019-10-01)"
#define Log_PLATFORM_VERSION "SWAD 19.30 (2019-10-01)"
#define CSS_FILE "swad19.29.css"
#define JS_FILE "swad19.15.js"
#define JS_FILE "swad19.30.js"
/*
// TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas)
Version 19.30: Oct 01, 2019 The match refreshment time for teachers is now different from the time for students.
Code refactoring in matchs.
Code refactoring in new timeline. (246902 lines)
Version 19.29.1: Oct 01, 2019 Changed refreshing time in matches.
Fixed bug in icon reported by Francisco Javier Fernández Baldomero.
Fixed bug in closing window in matches. (246900 lines)

View File

@ -503,8 +503,10 @@
#define Cfg_TIME_TO_REFRESH_TIMELINE ((time_t)( 2UL * 1000UL)) // Initial refresh period of social timeline in miliseconds
// This delay is increased 1 second on each refresh
#define Cfg_SECONDS_TO_REFRESH_MATCH 2 // Refresh period of game being played in seconds
#define Cfg_TIME_TO_REFRESH_MATCH ((time_t)(Cfg_SECONDS_TO_REFRESH_MATCH * 1000UL)) // Refresh period of game being played in miliseconds
#define Cfg_SECONDS_TO_REFRESH_MATCH_TCH 1 // Refresh period of match being played in seconds (for teachers)
#define Cfg_SECONDS_TO_REFRESH_MATCH_STD 5 // Refresh period of match being played in seconds (for students)
#define Cfg_TIME_TO_REFRESH_MATCH_TCH ((time_t)(Cfg_SECONDS_TO_REFRESH_MATCH_TCH * 1000UL)) // Refresh period of match being played in miliseconds (for teachers)
#define Cfg_TIME_TO_REFRESH_MATCH_STD ((time_t)(Cfg_SECONDS_TO_REFRESH_MATCH_STD * 1000UL)) // Refresh period of match being played in miliseconds (for students)
#define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds

View File

@ -719,13 +719,12 @@ static void Lay_WriteScriptInit (void)
Dat_WriteScriptMonths ();
if (RefreshNewTimeline)
fprintf (Gbl.F.Out,"\tvar delayNewTimeline = %lu;\n",
Cfg_TIME_TO_REFRESH_TIMELINE);
else if (RefreshMatchStd ||
RefreshMatchTch) // Refresh match via AJAX
fprintf (Gbl.F.Out,"\tvar delayMatch = %lu;\n",
Cfg_TIME_TO_REFRESH_MATCH);
if (RefreshNewTimeline) // Refresh new timeline via AJAX
fprintf (Gbl.F.Out,"\tvar delayNewTL = %lu;\n",Cfg_TIME_TO_REFRESH_TIMELINE);
else if (RefreshMatchStd) // Refresh match via AJAX
fprintf (Gbl.F.Out,"\tvar delayMatch = %lu;\n",Cfg_TIME_TO_REFRESH_MATCH_STD);
else if (RefreshMatchTch) // Refresh match via AJAX
fprintf (Gbl.F.Out,"\tvar delayMatch = %lu;\n",Cfg_TIME_TO_REFRESH_MATCH_TCH);
fprintf (Gbl.F.Out,"function init(){\n");
@ -747,7 +746,7 @@ static void Lay_WriteScriptInit (void)
else if (RefreshMatchTch) // Refresh match for a teacher via AJAX
fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshMatchTch()\",delayMatch);\n");
else if (RefreshNewTimeline) // Refresh timeline via AJAX
fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshNewTimeline()\",delayNewTimeline);\n");
fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshNewTL()\",delayNewTL);\n");
fprintf (Gbl.F.Out,"}\n"
"</script>\n");

View File

@ -1328,7 +1328,8 @@ void Mch_ResumeMatch (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -1658,8 +1659,8 @@ static void Mch_UpdateElapsedTimeInQuestion (struct Match *Match)
" ON DUPLICATE KEY"
" UPDATE ElapsedTime=ADDTIME(ElapsedTime,SEC_TO_TIME(%u))",
Match->MchCod,Match->Status.QstInd,
Cfg_SECONDS_TO_REFRESH_MATCH,
Cfg_SECONDS_TO_REFRESH_MATCH);
Cfg_SECONDS_TO_REFRESH_MATCH_TCH,
Cfg_SECONDS_TO_REFRESH_MATCH_TCH);
}
/*****************************************************************************/
@ -1746,7 +1747,8 @@ void Mch_PauseMatch (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -1774,7 +1776,8 @@ void Mch_PlayMatch (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -1807,7 +1810,8 @@ void Mch_ToggleVisibilResultsMchQst (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -1838,7 +1842,8 @@ void Mch_BackMatch (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -1866,7 +1871,8 @@ void Mch_ForwardMatch (void)
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -2711,17 +2717,17 @@ static void Mch_ShowWaitImage (const char *Txt)
static void Mch_RemoveOldPlayers (void)
{
/***** Delete matches not being played *****/
/***** Delete matches not being played by teacher *****/
DB_QueryDELETE ("can not update matches as not being played",
"DELETE FROM mch_playing"
" WHERE TS<FROM_UNIXTIME(UNIX_TIMESTAMP()-%lu)",
Cfg_SECONDS_TO_REFRESH_MATCH*3);
Cfg_SECONDS_TO_REFRESH_MATCH_TCH*3);
/***** Delete players who have left matches *****/
/***** Delete players (students) who have left matches *****/
DB_QueryDELETE ("can not update match players",
"DELETE FROM mch_players"
" WHERE TS<FROM_UNIXTIME(UNIX_TIMESTAMP()-%lu)",
Cfg_SECONDS_TO_REFRESH_MATCH*3);
Cfg_SECONDS_TO_REFRESH_MATCH_STD*3);
}
static void Mch_UpdateMatchAsBeingPlayed (long MchCod)
@ -2794,10 +2800,6 @@ void Mch_JoinMatchAsStd (void)
{
struct Match Match;
/***** Remove old players.
This function must be called before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
Match.MchCod = Gbl.Games.MchCodBeingPlayed;
Mch_GetDataOfMatchByCod (&Match);
@ -2820,7 +2822,8 @@ void Mch_RefreshMatchTch (void)
return;
/***** Remove old players.
This function must be called before getting match status. *****/
This function must be called by a teacher
before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
@ -2848,10 +2851,6 @@ void Mch_RefreshMatchStd (void)
if (!Gbl.Session.IsOpen) // If session has been closed, do not write anything
return;
/***** Remove old players.
This function must be called before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
Match.MchCod = Gbl.Games.MchCodBeingPlayed;
Mch_GetDataOfMatchByCod (&Match);
@ -2916,10 +2915,6 @@ void Mch_ReceiveQuestionAnswer (void)
unsigned NumQstsNotBlank;
double TotalScore;
/***** Remove old players.
This function must be called before getting match status. *****/
Mch_RemoveOldPlayers ();
/***** Get data of the match from database *****/
Match.MchCod = Gbl.Games.MchCodBeingPlayed;
Mch_GetDataOfMatchByCod (&Match);